税率接口及相关基础类
This commit is contained in:
parent
7dc77d0dab
commit
8922047306
|
|
@ -0,0 +1,300 @@
|
|||
package com.engine.salary.biz;
|
||||
|
||||
import com.engine.salary.entity.taxrate.SysTaxRateBase;
|
||||
import com.engine.salary.entity.taxrate.TaxRateBase;
|
||||
import com.engine.salary.entity.taxrate.TaxRateDetail;
|
||||
import com.engine.salary.entity.taxrate.bo.TaxRateBO;
|
||||
import com.engine.salary.entity.taxrate.param.TaxRateSaveParam;
|
||||
import com.engine.salary.enums.SalarySystemTypeEnum;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import com.engine.salary.mapper.SysTaxRateBaseMapper;
|
||||
import com.engine.salary.mapper.TaxRateBaseMapper;
|
||||
import com.engine.salary.mapper.TaxRateDetailMapper;
|
||||
import com.engine.salary.util.SalaryEntityUtil;
|
||||
import com.google.common.collect.Lists;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.ibatis.session.SqlSession;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import weaver.conn.mybatis.MyBatisFactory;
|
||||
import weaver.general.BaseBean;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class TaxRateBiz extends BaseBean {
|
||||
|
||||
|
||||
public TaxRateBase getById(Long id) {
|
||||
|
||||
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
|
||||
try {
|
||||
TaxRateBaseMapper taxRateBaseMapper = sqlSession.getMapper(TaxRateBaseMapper.class);
|
||||
SysTaxRateBaseMapper sysTaxRateBaseMapper = sqlSession.getMapper(SysTaxRateBaseMapper.class);
|
||||
TaxRateBase TaxRateBase = taxRateBaseMapper.getById(id);
|
||||
|
||||
// 如果自定义税率表中没有再查询系统默认的税率表
|
||||
if (Objects.isNull(TaxRateBase)) {
|
||||
SysTaxRateBase sysTaxRateBase = sysTaxRateBaseMapper.getById(id);
|
||||
TaxRateBase = new TaxRateBase();
|
||||
BeanUtils.copyProperties(sysTaxRateBase, TaxRateBase);
|
||||
}
|
||||
|
||||
return TaxRateBase;
|
||||
} finally {
|
||||
sqlSession.close();
|
||||
}
|
||||
}
|
||||
|
||||
public List<TaxRateBase> listByIds(Collection<Long> ids) {
|
||||
|
||||
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
|
||||
try {
|
||||
TaxRateBaseMapper taxRateBaseMapper = sqlSession.getMapper(TaxRateBaseMapper.class);
|
||||
SysTaxRateBaseMapper sysTaxRateBaseMapper = sqlSession.getMapper(SysTaxRateBaseMapper.class);
|
||||
|
||||
if (CollectionUtils.isEmpty(ids)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
List<TaxRateBase> resultList = Lists.newArrayListWithExpectedSize(ids.size());
|
||||
// 查询系统默认的税率表
|
||||
List<SysTaxRateBase> sysTaxRateBases = sysTaxRateBaseMapper.selectByIds(ids);
|
||||
List<TaxRateBase> TaxRateBaseS4Sys = sysTaxRateBases.stream()
|
||||
.map(sysTaxRateBase -> {
|
||||
TaxRateBase TaxRateBase = new TaxRateBase();
|
||||
BeanUtils.copyProperties(sysTaxRateBase, TaxRateBase);
|
||||
return TaxRateBase;
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
resultList.addAll(TaxRateBaseS4Sys);
|
||||
|
||||
// 查询自定义税率表
|
||||
List<TaxRateBase> taxRateBases = taxRateBaseMapper.selectByIds(ids);
|
||||
resultList.addAll(taxRateBases);
|
||||
|
||||
return resultList;
|
||||
|
||||
} finally {
|
||||
sqlSession.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public List<TaxRateBase> listByName(String name) {
|
||||
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
|
||||
try {
|
||||
TaxRateBaseMapper taxRateBaseMapper = sqlSession.getMapper(TaxRateBaseMapper.class);
|
||||
SysTaxRateBaseMapper sysTaxRateBaseMapper = sqlSession.getMapper(SysTaxRateBaseMapper.class);
|
||||
|
||||
List<TaxRateBase> resultList = Lists.newArrayList();
|
||||
|
||||
// 查询系统默认的税率表
|
||||
List<SysTaxRateBase> sysTaxRateBases = sysTaxRateBaseMapper.listBySome(SysTaxRateBase.builder().name(name).build());
|
||||
List<TaxRateBase> TaxRateBaseS4Sys = sysTaxRateBases.stream()
|
||||
.map(sysTaxRateBase -> {
|
||||
TaxRateBase TaxRateBase = new TaxRateBase();
|
||||
BeanUtils.copyProperties(sysTaxRateBase, TaxRateBase);
|
||||
return TaxRateBase;
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
resultList.addAll(TaxRateBaseS4Sys);
|
||||
|
||||
// 查询自定义税率表
|
||||
List<TaxRateBase> TaxRateBaseS = taxRateBaseMapper.listBySome(TaxRateBase.builder().name(name).build());
|
||||
resultList.addAll(TaxRateBaseS);
|
||||
|
||||
return resultList;
|
||||
|
||||
} finally {
|
||||
sqlSession.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public List<TaxRateBase> list(String tenantKey) {
|
||||
List<TaxRateBase> resultList = Lists.newArrayList();
|
||||
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
|
||||
try {
|
||||
SysTaxRateBaseMapper sysTaxRateBaseMapper = sqlSession.getMapper(SysTaxRateBaseMapper.class);
|
||||
TaxRateBaseMapper taxRateBaseMapper = sqlSession.getMapper(TaxRateBaseMapper.class);
|
||||
|
||||
// 查询系统默认的税率表
|
||||
List<SysTaxRateBase> sysTaxRateBases = sysTaxRateBaseMapper.listAll();
|
||||
List<TaxRateBase> TaxRateBaseS4Sys = sysTaxRateBases.stream()
|
||||
.map(sysTaxRateBase -> {
|
||||
TaxRateBase TaxRateBase = new TaxRateBase();
|
||||
BeanUtils.copyProperties(sysTaxRateBase, TaxRateBase);
|
||||
return TaxRateBase;
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
resultList.addAll(TaxRateBaseS4Sys);
|
||||
|
||||
// 查询自定义税率表
|
||||
List<TaxRateBase> TaxRateBaseS = taxRateBaseMapper.listAll();
|
||||
resultList.addAll(TaxRateBaseS);
|
||||
|
||||
} finally {
|
||||
sqlSession.close();
|
||||
}
|
||||
|
||||
return resultList;
|
||||
}
|
||||
|
||||
public void deleteByIds(Collection<Long> ids) {
|
||||
// 查询待删除的个税税率表主表
|
||||
List<TaxRateBase> TaxRateBaseS = listByIds(ids);
|
||||
if (CollectionUtils.isEmpty(TaxRateBaseS)) {
|
||||
throw new SalaryRunTimeException("个税税率表不存在");
|
||||
}
|
||||
// 系统默认的个税税率表不允许删除
|
||||
boolean containSystem = TaxRateBaseS.stream()
|
||||
.anyMatch(taxRateBatchPO -> SalarySystemTypeEnum.parseByValue(taxRateBatchPO.getSystemType()) == SalarySystemTypeEnum.SYSTEM);
|
||||
if (containSystem) {
|
||||
throw new SalaryRunTimeException("系统默认的税率表不允许删除");
|
||||
}
|
||||
ids = SalaryEntityUtil.properties(TaxRateBaseS, TaxRateBase::getId);
|
||||
// 记录日志
|
||||
// TaxRateBaseS.forEach(taxRateBatchPO -> {
|
||||
// LoggerContext<TaxRateBase> loggerContext = new LoggerContext<>();
|
||||
// loggerContext.setTargetId(String.valueOf(taxRateBatchPO.getId()));
|
||||
// loggerContext.setTargetName(taxRateBatchPO.getName());
|
||||
// loggerContext.setOperateType(OperateTypeEnum.DELETE.getValue());
|
||||
// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(98120, "删除个税税率表"));
|
||||
// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(98120, "删除个税税率表"));
|
||||
// loggerContext.setNewValues(taxRateBatchPO);
|
||||
// taxRateLoggerTemplate.write(loggerContext);
|
||||
// });
|
||||
|
||||
|
||||
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
|
||||
try {
|
||||
TaxRateBaseMapper taxRateBaseMapper = sqlSession.getMapper(TaxRateBaseMapper.class);
|
||||
TaxRateDetailMapper taxRateDetailMapper = sqlSession.getMapper(TaxRateDetailMapper.class);
|
||||
// 删除主表
|
||||
taxRateBaseMapper.deleteByIds(ids);
|
||||
// 删除明细表
|
||||
taxRateDetailMapper.deleteByBatchIds(ids);
|
||||
|
||||
sqlSession.commit();
|
||||
} finally {
|
||||
sqlSession.close();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void save(TaxRateSaveParam saveParam, Long employeeId) {
|
||||
|
||||
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
|
||||
try {
|
||||
SysTaxRateBaseMapper sysTaxRateBaseMapper = sqlSession.getMapper(SysTaxRateBaseMapper.class);
|
||||
TaxRateBaseMapper taxRateBaseMapper = sqlSession.getMapper(TaxRateBaseMapper.class);
|
||||
TaxRateDetailMapper taxRateDetailMapper = sqlSession.getMapper(TaxRateDetailMapper.class);
|
||||
|
||||
// 个税税率表主表名称不允许重复
|
||||
List<TaxRateBase> TaxRateBaseS = listByName(saveParam.getTaxRateBatch().getName());
|
||||
if (CollectionUtils.isNotEmpty(TaxRateBaseS)) {
|
||||
throw new SalaryRunTimeException("名称不允许重复");
|
||||
}
|
||||
// 保存个税税率表主表
|
||||
TaxRateBase TaxRateBase = TaxRateBO.convert2BatchPO(saveParam.getTaxRateBatch(), employeeId);
|
||||
taxRateBaseMapper.insert(TaxRateBase);
|
||||
// 记录日志
|
||||
// LoggerContext loggerContext = new LoggerContext<>();
|
||||
// loggerContext.setTargetId(String.valueOf(TaxRateBase.getId()));
|
||||
// loggerContext.setTargetName(TaxRateBase.getName());
|
||||
// loggerContext.setOperateType(OperateTypeEnum.ADD.getValue());
|
||||
// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(98107, "新增个税税率表(基础信息)"));
|
||||
// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(86124, "基础信息"));
|
||||
// loggerContext.setNewValues(TaxRateBase);
|
||||
// taxRateLoggerTemplate.write(loggerContext);
|
||||
// 保存个税税率表明细表
|
||||
List<TaxRateDetail> taxRateDetailPOS = TaxRateBO.convert2RecordPO(TaxRateBase.getId(), saveParam.getTaxRateRecords(), employeeId);
|
||||
new TaxRateDetailBiz().saveBatch(taxRateDetailPOS);
|
||||
// 记录日志
|
||||
// LoggerContext detailLoggerContext = new LoggerContext<>();
|
||||
// detailLoggerContext.setTargetId(String.valueOf(TaxRateBase.getId()));
|
||||
// detailLoggerContext.setTargetName(TaxRateBase.getName());
|
||||
// detailLoggerContext.setOperateType(OperateTypeEnum.ADD.getValue());
|
||||
// detailLoggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(98125, "新增个税税率表(详细设置)"));
|
||||
// detailLoggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(96687, "详细设置"));
|
||||
// detailLoggerContext.setNewValueList(taxRateDetailPOS);
|
||||
// taxRateLoggerTemplate.write(loggerContext);
|
||||
|
||||
|
||||
sqlSession.commit();
|
||||
|
||||
} finally {
|
||||
sqlSession.close();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void update(TaxRateSaveParam updateParam, Long employeeId) {
|
||||
|
||||
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
|
||||
try {
|
||||
SysTaxRateBaseMapper sysTaxRateBaseMapper = sqlSession.getMapper(SysTaxRateBaseMapper.class);
|
||||
TaxRateBaseMapper taxRateBaseMapper = sqlSession.getMapper(TaxRateBaseMapper.class);
|
||||
TaxRateDetailMapper taxRateDetailMapper = sqlSession.getMapper(TaxRateDetailMapper.class);
|
||||
|
||||
// 查询是否存在指定的个税税率表
|
||||
TaxRateBase TaxRateBase = getById(updateParam.getTaxRateBatch().getId());
|
||||
if (Objects.isNull(TaxRateBase)) {
|
||||
throw new SalaryRunTimeException("个税税率表不存在");
|
||||
}
|
||||
// 个税税率表主表名称不允许重复
|
||||
List<TaxRateBase> TaxRateBaseS = listByName(updateParam.getTaxRateBatch().getName());
|
||||
boolean nameExist = !CollectionUtils.isEmpty(TaxRateBaseS) &&
|
||||
TaxRateBaseS.stream().anyMatch(e -> !Objects.equals(e.getId(), updateParam.getTaxRateBatch().getId()));
|
||||
if (nameExist) {
|
||||
throw new SalaryRunTimeException("名称不允许重复");
|
||||
}
|
||||
// 系统默认的个税税率表不允许编辑
|
||||
if (SalarySystemTypeEnum.parseByValue(TaxRateBase.getSystemType()) == SalarySystemTypeEnum.SYSTEM) {
|
||||
throw new SalaryRunTimeException("系统默认的个税税率表不允许编辑");
|
||||
}
|
||||
// 更新个税税率表主表
|
||||
TaxRateBase newTaxRateBase = new TaxRateBase();
|
||||
BeanUtils.copyProperties(TaxRateBase, newTaxRateBase);
|
||||
newTaxRateBase.setName(updateParam.getTaxRateBatch().getName());
|
||||
newTaxRateBase.setDescription(updateParam.getTaxRateBatch().getDescription());
|
||||
taxRateBaseMapper.updateIgnoreNull(newTaxRateBase);
|
||||
// 记录日志
|
||||
// LoggerContext loggerContext = new LoggerContext<>();
|
||||
// loggerContext.setTargetId(String.valueOf(TaxRateBase.getId()));
|
||||
// loggerContext.setTargetName(TaxRateBase.getName());
|
||||
// loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue());
|
||||
// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(98108, "编辑个税税率表(基础信息)"));
|
||||
// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(86124, "基础信息"));
|
||||
// loggerContext.setOldValues(TaxRateBase);
|
||||
// loggerContext.setNewValues(newTaxRateBase);
|
||||
// taxRateLoggerTemplate.write(loggerContext);
|
||||
// 更新个税税率表明细表-先删除后插入
|
||||
List<TaxRateDetail> taxRateDetailPOS = taxRateDetailMapper.listByBaseId(TaxRateBase.getId());
|
||||
taxRateDetailMapper.deleteByBatchIds(Collections.singleton(TaxRateBase.getId()));
|
||||
List<TaxRateDetail> newTaxRateDetailPOS = TaxRateBO.convert2RecordPO(TaxRateBase.getId(), updateParam.getTaxRateRecords(), employeeId);
|
||||
new TaxRateDetailBiz().saveBatch(taxRateDetailPOS);
|
||||
// 记录日志
|
||||
// LoggerContext detailLoggerContext = new LoggerContext<>();
|
||||
// detailLoggerContext.setTargetId(String.valueOf(TaxRateBase.getId()));
|
||||
// detailLoggerContext.setTargetName(TaxRateBase.getName());
|
||||
// detailLoggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue());
|
||||
// detailLoggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(98128, "新增个税税率表(详细设置)"));
|
||||
// detailLoggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(96687, "详细设置"));
|
||||
// detailLoggerContext.setOldValueList(taxRateDetailPOS);
|
||||
// detailLoggerContext.setNewValueList(newTaxRateDetailPOS);
|
||||
// taxRateLoggerTemplate.write(loggerContext);
|
||||
|
||||
|
||||
sqlSession.commit();
|
||||
} finally {
|
||||
sqlSession.close();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
package com.engine.salary.biz;
|
||||
|
||||
import com.engine.salary.entity.taxrate.TaxRateDetail;
|
||||
import com.engine.salary.mapper.TaxRateDetailMapper;
|
||||
import org.apache.ibatis.session.SqlSession;
|
||||
import weaver.conn.mybatis.MyBatisFactory;
|
||||
import weaver.general.BaseBean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class TaxRateDetailBiz extends BaseBean {
|
||||
|
||||
public void saveBatch(List<TaxRateDetail> list) {
|
||||
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
|
||||
try {
|
||||
TaxRateDetailMapper taxRateDetailMapper = sqlSession.getMapper(TaxRateDetailMapper.class);
|
||||
|
||||
list.forEach(taxRateDetailMapper::insert);
|
||||
|
||||
sqlSession.commit();
|
||||
} finally {
|
||||
sqlSession.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
package com.engine.salary.cmd.TaxRate;
|
||||
|
||||
import com.engine.common.biz.AbstractCommonCommand;
|
||||
import com.engine.common.entity.BizLogContext;
|
||||
import com.engine.core.interceptor.CommandContext;
|
||||
import com.engine.salary.biz.TaxRateBiz;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import com.engine.salary.util.DataUtil;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class TaxRateDeleteCmd extends AbstractCommonCommand<Map<String, Object>> {
|
||||
|
||||
public TaxRateDeleteCmd(Map<String, Object> params, User user) {
|
||||
this.user = user;
|
||||
this.params = params;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BizLogContext getLogContext() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> execute(CommandContext commandContext) {
|
||||
Map<String, Object> apidatas = new HashMap<String, Object>(16);
|
||||
|
||||
|
||||
List<String> idStrs = DataUtil.castList(params.get("ids"), String.class);
|
||||
if (CollectionUtils.isEmpty(idStrs)) {
|
||||
throw new SalaryRunTimeException("参数错误");
|
||||
}
|
||||
List<Long> ids = idStrs.stream().map(Long::valueOf).collect(Collectors.toList());
|
||||
TaxRateBiz taxRateBiz = new TaxRateBiz();
|
||||
|
||||
taxRateBiz.deleteByIds(ids);
|
||||
|
||||
return apidatas;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,83 @@
|
|||
package com.engine.salary.cmd.TaxRate;
|
||||
|
||||
import com.cloudstore.eccom.constant.WeaBoolAttr;
|
||||
import com.cloudstore.eccom.pc.table.WeaTable;
|
||||
import com.cloudstore.eccom.pc.table.WeaTableColumn;
|
||||
import com.cloudstore.eccom.result.WeaResultMsg;
|
||||
import com.engine.common.biz.AbstractCommonCommand;
|
||||
import com.engine.common.entity.BizLogContext;
|
||||
import com.engine.core.interceptor.CommandContext;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import weaver.general.PageIdConst;
|
||||
import weaver.general.Util;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class TaxRateListCmd extends AbstractCommonCommand<Map<String, Object>> {
|
||||
|
||||
public TaxRateListCmd(Map<String, Object> params, User user) {
|
||||
this.user = user;
|
||||
this.params = params;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BizLogContext getLogContext() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> execute(CommandContext commandContext) {
|
||||
|
||||
Map<String, Object> apidatas = new HashMap<String, Object>(16);
|
||||
|
||||
WeaResultMsg result = new WeaResultMsg(false);
|
||||
String pageID = "a4f85287-e3f9-4275-9527-7d06e54y6rj8";
|
||||
String pageUid = pageID + "_" + user.getUID();
|
||||
String pageSize = PageIdConst.getPageSize(pageID, user.getUID());
|
||||
|
||||
|
||||
String fileds = " create_time,creator,delete_type, description, id, name, system_type, tenant_key, update_time";
|
||||
String sql = " from hrsa_sys_tax_rate_base s " +
|
||||
" where s.delete_type = 0";
|
||||
//模糊查询
|
||||
String name = Util.null2String(params.get("name"));
|
||||
if (StringUtils.isNotBlank(name)) {
|
||||
sql += " and s.name like '%" + name + "%' ";
|
||||
}
|
||||
sql += " union all " +
|
||||
" select create_time,creator,delete_type, description, id, name, system_type, tenant_key, update_time " +
|
||||
" from hrsa_tax_rate_base b " +
|
||||
" where b.delete_type = 0 ";
|
||||
//模糊查询
|
||||
if (StringUtils.isNotBlank(name)) {
|
||||
sql += " and b.name like '%" + name + "%' ";
|
||||
}
|
||||
|
||||
WeaTable table = new WeaTable();
|
||||
table.setPageUID(pageUid);
|
||||
table.setPageID(pageID);
|
||||
table.setPagesize(pageSize);
|
||||
table.setBackfields(fileds);
|
||||
table.setSqlform(sql);
|
||||
// table.setSqlwhere();
|
||||
table.setSqlorderby("id desc");
|
||||
table.setSqlprimarykey("id");
|
||||
table.setSqlisdistinct("false");
|
||||
|
||||
table.getColumns().add(new WeaTableColumn("id").setDisplay(WeaBoolAttr.FALSE));
|
||||
table.getColumns().add(new WeaTableColumn("20%", "名称", "name", ""));
|
||||
table.getColumns().add(new WeaTableColumn("20%", "名称", "systemType", ""));
|
||||
table.getColumns().add(new WeaTableColumn("20%", "名称", "createTime", ""));
|
||||
table.getColumns().add(new WeaTableColumn("20%", "名称", "description", ""));
|
||||
|
||||
//设置check是否可用
|
||||
table.setCheckboxList(null);
|
||||
table.setCheckboxpopedom(null);
|
||||
result.putAll(table.makeDataResult());
|
||||
result.success();
|
||||
apidatas = result.getResultMap();
|
||||
return apidatas;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
package com.engine.salary.cmd.TaxRate;
|
||||
|
||||
import com.engine.common.biz.AbstractCommonCommand;
|
||||
import com.engine.common.entity.BizLogContext;
|
||||
import com.engine.core.interceptor.CommandContext;
|
||||
import com.engine.salary.biz.TaxRateBiz;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import com.engine.salary.util.DataUtil;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class TaxRateSaveCmd extends AbstractCommonCommand<Map<String, Object>> {
|
||||
|
||||
public TaxRateSaveCmd(Map<String, Object> params, User user) {
|
||||
this.user = user;
|
||||
this.params = params;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BizLogContext getLogContext() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> execute(CommandContext commandContext) {
|
||||
Map<String, Object> apidatas = new HashMap<String, Object>(16);
|
||||
|
||||
|
||||
List<String> idStrs = DataUtil.castList(params.get("ids"), String.class);
|
||||
if (CollectionUtils.isEmpty(idStrs)) {
|
||||
throw new SalaryRunTimeException("参数错误");
|
||||
}
|
||||
List<Long> ids = idStrs.stream().map(Long::valueOf).collect(Collectors.toList());
|
||||
TaxRateBiz taxRateBiz = new TaxRateBiz();
|
||||
|
||||
// taxRateBiz.save();
|
||||
|
||||
return apidatas;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
package com.engine.salary.entity.taxrate;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 系统内置的税率表
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SysTaxRateBase {
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private Long creator;
|
||||
/**
|
||||
* 是否已删除。0:未删除、1:已删除
|
||||
*/
|
||||
private Integer deleteType;
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private String description;
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 是否是系统默认的。0:自定义、1:系统默认
|
||||
*/
|
||||
private Byte systemType;
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
private String tenantKey;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
package com.engine.salary.entity.taxrate;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 税率主表
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class TaxRateBase {
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private Long creator;
|
||||
/**
|
||||
* 是否已删除。0:未删除、1:已删除
|
||||
*/
|
||||
private Integer deleteType;
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private String description;
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 是否是系统默认的。0:自定义、1:系统默认
|
||||
*/
|
||||
private Integer systemType;
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
private String tenantKey;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,84 @@
|
|||
package com.engine.salary.entity.taxrate;
|
||||
|
||||
import java.util.Date;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 税率明细表
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class TaxRateDetail {
|
||||
/**
|
||||
* 税率主表hrsa_tax_rate_base的id
|
||||
*/
|
||||
private Long baseId;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private Long creator;
|
||||
/**
|
||||
* 是否已删除。0:未删除、1:已删除
|
||||
*/
|
||||
private Integer deleteType;
|
||||
/**
|
||||
* 免税标准-比例
|
||||
*/
|
||||
private BigDecimal dutyFreeRate;
|
||||
/**
|
||||
* 免税标准-固定值
|
||||
*/
|
||||
private BigDecimal dutyFreeValue;
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
* 收入下限(不含)
|
||||
*/
|
||||
private BigDecimal incomeLowerLimit;
|
||||
/**
|
||||
* 收入上限(含)
|
||||
*/
|
||||
private BigDecimal incomeUpperLimit;
|
||||
/**
|
||||
* 序号
|
||||
*/
|
||||
private Integer indexNum;
|
||||
/**
|
||||
* 速算扣除数
|
||||
*/
|
||||
private BigDecimal taxDeduction;
|
||||
/**
|
||||
* 税率
|
||||
*/
|
||||
private BigDecimal taxRate;
|
||||
/**
|
||||
* 应纳税所得额下限(不含)
|
||||
*/
|
||||
private BigDecimal taxableIncomeLl;
|
||||
/**
|
||||
* 应纳税所得额上限(含)
|
||||
*/
|
||||
private BigDecimal taxableIncomeUl;
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
private String tenantKey;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,189 @@
|
|||
package com.engine.salary.entity.taxrate.bo;
|
||||
|
||||
import com.engine.salary.constant.SalaryDefaultTenantConstant;
|
||||
import com.engine.salary.entity.taxrate.TaxRateBase;
|
||||
import com.engine.salary.entity.taxrate.TaxRateDetail;
|
||||
import com.engine.salary.entity.taxrate.param.TaxRateBaseSaveParam;
|
||||
import com.engine.salary.entity.taxrate.param.TaxRateDetailSaveParam;
|
||||
import com.engine.salary.enums.SalarySystemTypeEnum;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import com.google.common.collect.Lists;
|
||||
import dm.jdbc.util.IdGenerator;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @description: 税率表业务方法
|
||||
* @author: xiajun
|
||||
* @modified By: xiajun
|
||||
* @date: Created in 10/19/21 4:14 PM
|
||||
* @version:v1.0
|
||||
*/
|
||||
public class TaxRateBO {
|
||||
|
||||
private TaxRateBO() {
|
||||
throw new SalaryRunTimeException("该类不需要创建实例");
|
||||
}
|
||||
|
||||
/**
|
||||
* 转换成个税税率表的前端列表
|
||||
*
|
||||
* @param taxRateBatches
|
||||
* @return
|
||||
*/
|
||||
// public static List<TaxRateListDTO> convert2ListDTO(Collection<TaxRateBasePO> taxRateBatches) {
|
||||
// if (CollectionUtils.isEmpty(taxRateBatches)) {
|
||||
// return Collections.emptyList();
|
||||
// }
|
||||
// return taxRateBatches.stream()
|
||||
// .map(taxRateBatchPO -> {
|
||||
// SalarySystemTypeEnum typeEnum = SalarySystemTypeEnum.parseByValue(taxRateBatchPO.getSystemType());
|
||||
// return TaxRateListDTO.builder()
|
||||
// .id(taxRateBatchPO.getId())
|
||||
// .name(taxRateBatchPO.getName())
|
||||
// .systemType(Optional.ofNullable(typeEnum).map(e -> SalaryI18nUtil.getI18nLabel(e.getLabelId(), e.getDefaultLabel())).orElse(StringUtils.EMPTY))
|
||||
// .createTime(SalaryDateUtil.getFormatLocalDate(taxRateBatchPO.getCreateTime()))
|
||||
// .description(taxRateBatchPO.getDescription())
|
||||
// .build();
|
||||
// })
|
||||
// .collect(Collectors.toList());
|
||||
// }
|
||||
|
||||
/**
|
||||
* 转转成个税税率表的明细
|
||||
*
|
||||
* @param taxRateRecords
|
||||
* @return
|
||||
*/
|
||||
// public static List<TaxRateRecordDTO> convert2RecordDTO(Collection<TaxRateDetailPO> taxRateRecords) {
|
||||
// if (CollectionUtils.isEmpty(taxRateRecords)) {
|
||||
// return Collections.emptyList();
|
||||
// }
|
||||
// return taxRateRecords.stream()
|
||||
// .map(e -> TaxRateRecordDTO.builder()
|
||||
// .id(e.getId())
|
||||
// .batchId(e.getBaseId())
|
||||
// .indexNum(e.getIndexNum())
|
||||
// .incomeUpperLimit(e.getIncomeUpperLimit())
|
||||
// .incomeLowerLimit(e.getIncomeLowerLimit())
|
||||
// .dutyFreeValue(e.getDutyFreeValue())
|
||||
// .dutyFreeRate(e.getDutyFreeRate())
|
||||
// .taxableIncomeULimit(e.getTaxableIncomeULimit())
|
||||
// .taxableIncomeLLimit(e.getTaxableIncomeLLimit())
|
||||
// .taxRate(e.getTaxRate())
|
||||
// .taxDeduction(e.getTaxDeduction())
|
||||
// .build())
|
||||
// .collect(Collectors.toList());
|
||||
// }
|
||||
|
||||
/**
|
||||
* 个税税率表的基本信息的保存参数转换成对应的PO实体
|
||||
*
|
||||
* @param saveParam
|
||||
* @param employeeId
|
||||
* @return
|
||||
*/
|
||||
public static TaxRateBase convert2BatchPO(TaxRateBaseSaveParam saveParam, Long employeeId) {
|
||||
if (saveParam == null) {
|
||||
return null;
|
||||
}
|
||||
return TaxRateBase.builder()
|
||||
.id(IdGenerator.generate())
|
||||
.name(saveParam.getName())
|
||||
.systemType(SalarySystemTypeEnum.CUSTOM.getValue())
|
||||
.description(saveParam.getDescription())
|
||||
.createTime(new Date())
|
||||
.updateTime(new Date())
|
||||
.creator(employeeId)
|
||||
.tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY)
|
||||
.deleteType(0)
|
||||
.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* 个税税率表的明细的保存参数转换成对应的PO实体
|
||||
*
|
||||
* @param saveParams
|
||||
* @param employeeId
|
||||
* @return
|
||||
*/
|
||||
public static List<TaxRateDetail> convert2RecordPO(Long taxRateBatchId, Collection<TaxRateDetailSaveParam> saveParams, Long employeeId) {
|
||||
if (CollectionUtils.isEmpty(saveParams)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return saveParams.stream()
|
||||
.map(e -> TaxRateDetail.builder()
|
||||
.id(IdGenerator.generate())
|
||||
.baseId(taxRateBatchId)
|
||||
.indexNum(e.getIndexNum())
|
||||
.incomeUpperLimit(e.getIncomeUpperLimit())
|
||||
.incomeLowerLimit(e.getIncomeLowerLimit())
|
||||
.dutyFreeValue(e.getDutyFreeValue())
|
||||
.dutyFreeRate(e.getDutyFreeRate())
|
||||
.taxableIncomeUl(Optional.ofNullable(e.getTaxableIncomeULimit()).orElse(BigDecimal.ZERO))
|
||||
.taxableIncomeLl(Optional.ofNullable(e.getTaxableIncomeLLimit()).orElse(BigDecimal.ZERO))
|
||||
.taxRate(Optional.ofNullable(e.getTaxRate()).orElse(BigDecimal.ZERO))
|
||||
.taxDeduction(Optional.ofNullable(e.getTaxDeduction()).orElse(BigDecimal.ZERO))
|
||||
.createTime(new Date())
|
||||
.updateTime(new Date())
|
||||
.creator(employeeId)
|
||||
.tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY)
|
||||
.deleteType(0)
|
||||
.build())
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
// /**
|
||||
// * 个税税率表明细表的前端表格的表头
|
||||
// *
|
||||
// * @return
|
||||
// */
|
||||
// public static List<WeaTableColumn> buildRecordTableColumns() {
|
||||
// List<WeaTableColumn> result = Lists.newArrayListWithExpectedSize(9);
|
||||
// result.add(new WeaTableColumnWapper(SalaryI18nUtil.getI18nLabel(84162, "序号"), TaxRateDataIndexConstant.INDEX_NUM, "150",
|
||||
// WeaAlignEnum.LEFT.getStringVal(), WeaAlignEnum.LEFT.getStringVal(), TaxRateDataIndexConstant.INDEX_NUM));
|
||||
// result.add(new WeaTableColumnWapper(SalaryI18nUtil.getI18nLabel(91070, "下限(不含)"), TaxRateDataIndexConstant.INCOME_LOWER_LIMIT, "150",
|
||||
// WeaAlignEnum.LEFT.getStringVal(), WeaAlignEnum.LEFT.getStringVal(), TaxRateDataIndexConstant.INCOME_LOWER_LIMIT));
|
||||
// result.add(new WeaTableColumnWapper(SalaryI18nUtil.getI18nLabel(91071, "上限(含)"), TaxRateDataIndexConstant.INCOME_UPPER_LIMIT, "150",
|
||||
// WeaAlignEnum.LEFT.getStringVal(), WeaAlignEnum.LEFT.getStringVal(), TaxRateDataIndexConstant.INCOME_UPPER_LIMIT));
|
||||
// result.add(new WeaTableColumnWapper(SalaryI18nUtil.getI18nLabel(91072, "固定值"), TaxRateDataIndexConstant.DUTY_FREE_VALUE, "150",
|
||||
// WeaAlignEnum.LEFT.getStringVal(), WeaAlignEnum.LEFT.getStringVal(), TaxRateDataIndexConstant.DUTY_FREE_VALUE));
|
||||
// result.add(new WeaTableColumnWapper(SalaryI18nUtil.getI18nLabel(91073, "比例"), TaxRateDataIndexConstant.DUTY_FREE_RATE, "150",
|
||||
// WeaAlignEnum.LEFT.getStringVal(), WeaAlignEnum.LEFT.getStringVal(), TaxRateDataIndexConstant.DUTY_FREE_RATE));
|
||||
// result.add(new WeaTableColumnWapper(SalaryI18nUtil.getI18nLabel(91070, "下限(不含)"), TaxRateDataIndexConstant.TAXABLE_INCOME_LOWER_LIMIT, "150",
|
||||
// WeaAlignEnum.LEFT.getStringVal(), WeaAlignEnum.LEFT.getStringVal(), TaxRateDataIndexConstant.TAXABLE_INCOME_LOWER_LIMIT));
|
||||
// result.add(new WeaTableColumnWapper(SalaryI18nUtil.getI18nLabel(91071, "上限(含)"), TaxRateDataIndexConstant.TAXABLE_INCOME_UPPER_LIMIT, "150",
|
||||
// WeaAlignEnum.LEFT.getStringVal(), WeaAlignEnum.LEFT.getStringVal(), TaxRateDataIndexConstant.TAXABLE_INCOME_UPPER_LIMIT));
|
||||
// result.add(new WeaTableColumnWapper(SalaryI18nUtil.getI18nLabel(84227, "税率"), TaxRateDataIndexConstant.TAX_RATE, "150",
|
||||
// WeaAlignEnum.LEFT.getStringVal(), WeaAlignEnum.LEFT.getStringVal(), TaxRateDataIndexConstant.TAX_RATE));
|
||||
// result.add(new WeaTableColumnWapper(SalaryI18nUtil.getI18nLabel(84228, "速算扣除数"), TaxRateDataIndexConstant.TAX_DEDUCTION, "150",
|
||||
// WeaAlignEnum.LEFT.getStringVal(), WeaAlignEnum.LEFT.getStringVal(), TaxRateDataIndexConstant.TAX_DEDUCTION));
|
||||
// return result;
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 新建个税税率表时,明细会默认自带一条空数据
|
||||
// *
|
||||
// * @param systemType
|
||||
// * @return
|
||||
// */
|
||||
// public static Map<String, EditableTableItem> buildEditableTableItemMap(SalarySystemTypeEnum systemType) {
|
||||
// boolean readOnly = systemType == SalarySystemTypeEnum.SYSTEM;
|
||||
// Map<String, EditableTableItem> resultMap = Maps.newHashMapWithExpectedSize(9);
|
||||
// resultMap.put(TaxRateDataIndexConstant.INDEX_NUM, new EditableTableItem(EditableTableItemType.INPUTNUMBER, "", true));
|
||||
// resultMap.put(TaxRateDataIndexConstant.INCOME_LOWER_LIMIT, new EditableTableItem(EditableTableItemType.INPUTNUMBER, "", readOnly, null, false, 9999999999L, 2, true));
|
||||
// resultMap.put(TaxRateDataIndexConstant.INCOME_UPPER_LIMIT, new EditableTableItem(EditableTableItemType.INPUTNUMBER, "", readOnly, null, false, 9999999999L, 2, true));
|
||||
// resultMap.put(TaxRateDataIndexConstant.DUTY_FREE_VALUE, new EditableTableItem(EditableTableItemType.INPUTNUMBER, "", readOnly, null, false, 9999999999L, 2, true));
|
||||
// resultMap.put(TaxRateDataIndexConstant.DUTY_FREE_RATE, new EditableTableItem(EditableTableItemType.INPUTNUMBER, "", readOnly, null, false, 9999999999L, 2, true));
|
||||
// resultMap.put(TaxRateDataIndexConstant.TAXABLE_INCOME_LOWER_LIMIT, new EditableTableItem(EditableTableItemType.INPUTNUMBER, "", readOnly, null, false, 9999999999L, 2, true));
|
||||
// resultMap.put(TaxRateDataIndexConstant.TAXABLE_INCOME_UPPER_LIMIT, new EditableTableItem(EditableTableItemType.INPUTNUMBER, "", readOnly, null, false, 9999999999L, 2, true));
|
||||
// resultMap.put(TaxRateDataIndexConstant.TAX_RATE, new EditableTableItem(EditableTableItemType.INPUTNUMBER, "", readOnly, null, false, 1L, 2, true));
|
||||
// resultMap.put(TaxRateDataIndexConstant.TAX_DEDUCTION, new EditableTableItem(EditableTableItemType.INPUTNUMBER, "", readOnly, null, false, 9999999999L, 2, true));
|
||||
// return resultMap;
|
||||
// }
|
||||
}
|
||||
|
|
@ -0,0 +1,91 @@
|
|||
package com.engine.salary.entity.taxrate.bo;
|
||||
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @description: 税率表明细
|
||||
* @author: xiajun
|
||||
* @modified By: xiajun
|
||||
* @date: Created in 2/18/22 2:07 PM
|
||||
* @version:v1.0
|
||||
*/
|
||||
public class TaxRateDetailBO {
|
||||
|
||||
// /**
|
||||
// * 根据公式条件获取对应的税率
|
||||
// *
|
||||
// * @param taxRateDetailPOS
|
||||
// * @param isOr
|
||||
// * @param formulaFilterDataList
|
||||
// * @return
|
||||
// */
|
||||
// public static TaxRateDetailPO filter(List<TaxRateDetailPO> taxRateDetailPOS, boolean isOr, Collection<FormulaFilterData> formulaFilterDataList) {
|
||||
// if (CollectionUtils.isEmpty(taxRateDetailPOS)) {
|
||||
// return null;
|
||||
// }
|
||||
// return taxRateDetailPOS.stream()
|
||||
// .filter(taxRateDetailPO -> {
|
||||
// for (FormulaFilterData formulaFilterData : formulaFilterDataList) {
|
||||
// boolean result = filterByFormulaFilterData(taxRateDetailPO, formulaFilterData);
|
||||
// // 如果公式中的条件是or,只要有一个条件为true就返回true
|
||||
// if (isOr && result) {
|
||||
// return true;
|
||||
// }
|
||||
// // 如果公式中的条件是and,只要有一个条件为false就返回false
|
||||
// if (!isOr && !result) {
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
// // 如果公式中的条件是or,前面没有一个条件为true,则返回false
|
||||
// // 如果公式中的条件是and, 前面没有一个条件为false,则返回true
|
||||
// return !isOr;
|
||||
// })
|
||||
// .findFirst()
|
||||
// .orElse(null);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 根据公式条件和个税税率表的字段比对,看是否满足公式中的条件
|
||||
// *
|
||||
// * @param taxRateDetailPO
|
||||
// * @param formulaFilterData
|
||||
// * @return
|
||||
// */
|
||||
// private static boolean filterByFormulaFilterData(TaxRateDetailPO taxRateDetailPO, FormulaFilterData formulaFilterData) {
|
||||
// Map<String, Object> map = JsonUtil.parseMap(taxRateDetailPO, Object.class);
|
||||
// switch (formulaFilterData.getTerm()) {
|
||||
// case FormulaFilterData.TERM_EQ:
|
||||
// case FormulaFilterData.TERM_BEQ:
|
||||
// case FormulaFilterData.TERM_SEQ:
|
||||
// return Objects.equals(map.get(formulaFilterData.getFieldId()), formulaFilterData.getContent());
|
||||
// case FormulaFilterData.TERM_NOT_EQ:
|
||||
// return !Objects.equals(map.get(formulaFilterData.getFieldId()), formulaFilterData.getContent());
|
||||
// case FormulaFilterData.TERM_NULL:
|
||||
// return Objects.isNull(map.get(formulaFilterData.getFieldId()));
|
||||
// case FormulaFilterData.TERM_NOT_NULL:
|
||||
// return Objects.nonNull(map.get(formulaFilterData.getFieldId()));
|
||||
// case FormulaFilterData.TERM_LIKE:
|
||||
// return StringUtils.contains(String.valueOf(map.get(formulaFilterData.getFieldId())), formulaFilterData.getContent());
|
||||
// case FormulaFilterData.TERM_GT:
|
||||
// return SalaryEntityUtil.empty2Zero(String.valueOf(map.get(formulaFilterData.getFieldId())))
|
||||
// .compareTo(SalaryEntityUtil.empty2Zero(formulaFilterData.getContent())) > 0;
|
||||
// case FormulaFilterData.TERM_GE:
|
||||
// return SalaryEntityUtil.empty2Zero(String.valueOf(map.get(formulaFilterData.getFieldId())))
|
||||
// .compareTo(SalaryEntityUtil.empty2Zero(formulaFilterData.getContent())) >= 0;
|
||||
// case FormulaFilterData.TERM_LE:
|
||||
// return SalaryEntityUtil.empty2Zero(String.valueOf(map.get(formulaFilterData.getFieldId())))
|
||||
// .compareTo(SalaryEntityUtil.empty2Zero(formulaFilterData.getContent())) <= 0;
|
||||
// case FormulaFilterData.TERM_LT:
|
||||
// return SalaryEntityUtil.empty2Zero(String.valueOf(map.get(formulaFilterData.getFieldId())))
|
||||
// .compareTo(SalaryEntityUtil.empty2Zero(formulaFilterData.getContent())) < 0;
|
||||
// default:
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
package com.engine.salary.entity.taxrate.param;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
/**
|
||||
* @description: 个税税率表主表保存参数
|
||||
* @author: xiajun
|
||||
* @modified By: xiajun
|
||||
* @date: Created in 1/17/22 3:19 PM
|
||||
* @version:v1.0
|
||||
*/
|
||||
@Data
|
||||
public class TaxRateBaseSaveParam {
|
||||
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 名称不允许为空
|
||||
* 名称不能超过40个字符
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 说明不能超过80个字符
|
||||
*/
|
||||
private String description;
|
||||
}
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
package com.engine.salary.entity.taxrate.param;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @description: 个税税率表明细表保存参数
|
||||
* @author: xiajun
|
||||
* @modified By: xiajun
|
||||
* @date: Created in 1/17/22 3:22 PM
|
||||
* @version:v1.0
|
||||
*/
|
||||
@Data
|
||||
public class TaxRateDetailSaveParam {
|
||||
|
||||
//taxRateDetailMapper("主键id")
|
||||
private Long id;
|
||||
|
||||
//taxRateDetailMapper("税率主表id")
|
||||
private Long batchId;
|
||||
|
||||
//taxRateDetailMapper("序号")
|
||||
private Integer indexNum;
|
||||
|
||||
//taxRateDetailMapper("收入上限(含)")
|
||||
private BigDecimal incomeUpperLimit;
|
||||
|
||||
//taxRateDetailMapper("收入下限(不含)")
|
||||
private BigDecimal incomeLowerLimit;
|
||||
|
||||
//taxRateDetailMapper("免税标准-固定值")
|
||||
private BigDecimal dutyFreeValue;
|
||||
|
||||
//taxRateDetailMapper("免税标准-比例")
|
||||
private BigDecimal dutyFreeRate;
|
||||
|
||||
//taxRateDetailMapper("应纳税所得额上限(含)")
|
||||
private BigDecimal taxableIncomeULimit;
|
||||
|
||||
//taxRateDetailMapper("应纳税所得额下限(不含)")
|
||||
private BigDecimal taxableIncomeLLimit;
|
||||
|
||||
//taxRateDetailMapper("税率")
|
||||
private BigDecimal taxRate;
|
||||
|
||||
//taxRateDetailMapper("速算扣除数")
|
||||
private BigDecimal taxDeduction;
|
||||
}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
package com.engine.salary.entity.taxrate.param;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description: 税率表保存
|
||||
* @author: xiajun
|
||||
* @modified By: xiajun
|
||||
* @date: Created in 10/20/21 1:59 PM
|
||||
* @version:v1.0
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class TaxRateSaveParam {
|
||||
|
||||
/**
|
||||
* 基本信息不允许为空
|
||||
*/
|
||||
// @ApiModelProperty("基本信息")
|
||||
private TaxRateBaseSaveParam taxRateBatch;
|
||||
|
||||
/**
|
||||
* 详细设置不允许为空
|
||||
*/
|
||||
// @ApiModelProperty("详细设置")
|
||||
private List<TaxRateDetailSaveParam> taxRateRecords;
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
package com.engine.salary.enums;
|
||||
|
||||
/**
|
||||
* @description: 基础枚举
|
||||
* @author: xiajun
|
||||
* @modified By: xiajun
|
||||
* @date: Created in 11/11/21 5:21 PM
|
||||
* @version:v1.0
|
||||
*/
|
||||
public interface BaseEnum<T> {
|
||||
|
||||
String name();
|
||||
|
||||
T getValue();
|
||||
|
||||
Integer getLabelId();
|
||||
|
||||
String getDefaultLabel();
|
||||
}
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
package com.engine.salary.enums;
|
||||
|
||||
/**
|
||||
* @Description: 操作类型
|
||||
* @Author: wangxiangzhong
|
||||
* @Date: 2021/11/1 13:17
|
||||
*/
|
||||
public enum OperateTypeEnum {
|
||||
|
||||
ADD("1", "新增"),
|
||||
UPDATE("2", "更新"),
|
||||
DELETE("4", "删除");
|
||||
|
||||
private String value;
|
||||
|
||||
private String label;
|
||||
|
||||
OperateTypeEnum(String value, String label) {
|
||||
this.value = value;
|
||||
this.label = label;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public String getLabel() {
|
||||
return label;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
package com.engine.salary.enums;
|
||||
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @description: 薪资周期
|
||||
* @author: xiajun
|
||||
* @modified By: xiajun
|
||||
* @date: Created in 11/9/21 9:20 AM
|
||||
* @version:v1.0
|
||||
*/
|
||||
public enum SalaryCycleTypeEnum implements BaseEnum<Integer> {
|
||||
|
||||
BEFORE_LAST_MONTH(1, "上上月", 86075),
|
||||
LAST_MONTH(2, "上月", 86074),
|
||||
THIS_MONTH(3, "本月", 86072),
|
||||
NEXT_MONTH(4, "下月", 86073);
|
||||
|
||||
private int value;
|
||||
|
||||
private String defaultLabel;
|
||||
|
||||
private int labelId;
|
||||
|
||||
SalaryCycleTypeEnum(int value, String defaultLabel, int labelId) {
|
||||
this.value = value;
|
||||
this.defaultLabel = defaultLabel;
|
||||
this.labelId = labelId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDefaultLabel() {
|
||||
return defaultLabel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getLabelId() {
|
||||
return labelId;
|
||||
}
|
||||
|
||||
public static SalaryCycleTypeEnum parseByValue(int value) {
|
||||
for (SalaryCycleTypeEnum salaryCycleTypeEnum : SalaryCycleTypeEnum.values()) {
|
||||
if (Objects.equals(salaryCycleTypeEnum.getValue(), value)) {
|
||||
return salaryCycleTypeEnum;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,60 @@
|
|||
package com.engine.salary.enums;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @description: 薪资账目取值方式
|
||||
* @author: xiajun
|
||||
* @modified By: xiajun
|
||||
* @date: Created in 12/2/21 2:39 PM
|
||||
* @version:v1.0
|
||||
*/
|
||||
public enum SalaryDataSourceEnum implements BaseEnum<Integer> {
|
||||
|
||||
INPUT_IMPORT(0, "输入/导入", 92004),
|
||||
CUSTOM_FORMULA(1, "自定义公式", 92001),
|
||||
SALARY_ITEM(2, "薪资项目", 84960),
|
||||
EMPLOYEE_INFO(3, "员工基本信息", 85366),
|
||||
SALARY_ARCHIVES(4, "薪资档案", 85368),
|
||||
CUMULATIVE_SITUATION(5, "累计情况(工资、薪金)", 87521),
|
||||
SPE_ADDI_DEDUCTIONS(6, "累计专项附加扣除", 85380),
|
||||
SOCIAL_SECURITY(7, "社保福利", 87522),
|
||||
OTHER_DEDUCTION(8, "其他扣除", 85831),
|
||||
;
|
||||
|
||||
private int value;
|
||||
|
||||
private String defaultLabel;
|
||||
|
||||
private int labelId;
|
||||
|
||||
SalaryDataSourceEnum(int value, String defaultLabel, int labelId) {
|
||||
this.value = value;
|
||||
this.defaultLabel = defaultLabel;
|
||||
this.labelId = labelId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDefaultLabel() {
|
||||
return defaultLabel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getLabelId() {
|
||||
return labelId;
|
||||
}
|
||||
|
||||
public static SalaryDataSourceEnum parseByValue(int value) {
|
||||
for (SalaryDataSourceEnum salaryDataSourceEnum : SalaryDataSourceEnum.values()) {
|
||||
if (Objects.equals(salaryDataSourceEnum.getValue(), value)) {
|
||||
return salaryDataSourceEnum;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
package com.engine.salary.enums;
|
||||
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @description: 薪资项目公式引用分类
|
||||
* @author: xiajun
|
||||
* @modified By: xiajun
|
||||
* @date: Created in 11/1/21 10:16 AM
|
||||
* @version:v1.0
|
||||
*/
|
||||
public enum SalaryFormulaReferenceEnum implements BaseEnum<Integer> {
|
||||
|
||||
SALARY_ITEM(1, "薪资项目", 84960),
|
||||
// SALARY_ITEM_OF_HISTORY(2, "历史台账薪资项目", 85364),
|
||||
EMPLOYEE_INFO(3, "员工基本信息", 85366),
|
||||
SALARY_ARCHIVES(4, "薪资档案", 85368),
|
||||
ATTEND(5, "考勤引用", 85367),
|
||||
CUMULATIVE_SITUATION(6, "累计情况(工资、薪金)", 87521),
|
||||
SPECIAL_EXPENSE_DEDUCTIONS(7, "累计专项附加扣除", 85380),
|
||||
SOCIAL_SECURITY(8, "社保福利", 87522),
|
||||
OTHER_DEDUCTION(9, "其他免税扣除", 93849),
|
||||
;
|
||||
|
||||
private int value;
|
||||
|
||||
private String defaultLabel;
|
||||
|
||||
private int labelId;
|
||||
|
||||
SalaryFormulaReferenceEnum(int value, String defaultLabel, int labelId) {
|
||||
this.value = value;
|
||||
this.defaultLabel = defaultLabel;
|
||||
this.labelId = labelId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDefaultLabel() {
|
||||
return defaultLabel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getLabelId() {
|
||||
return labelId;
|
||||
}
|
||||
|
||||
public static SalaryFormulaReferenceEnum parseByValue(String value) {
|
||||
for (SalaryFormulaReferenceEnum referenceEnum : SalaryFormulaReferenceEnum.values()) {
|
||||
if (Objects.equals(referenceEnum.getValue() + "", value)) {
|
||||
return referenceEnum;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
package com.engine.salary.enums;
|
||||
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @description: 薪资项目属性
|
||||
* @author: xiajun
|
||||
* @modified By: xiajun
|
||||
* @date: Created in 10/25/21 2:23 PM
|
||||
* @version:v1.0
|
||||
*/
|
||||
public enum SalaryItemCategoryEnum implements BaseEnum<Integer> {
|
||||
|
||||
PRE_TAX_ADD(1, "税前加项", 84492),
|
||||
PRE_TAX_DUD(2, "税前减项", 84493),
|
||||
AFTER_TAX_ADD(3, "税后加项", 84494),
|
||||
AFTER_TAX_DUD(4, "税后减项", 84495),
|
||||
SUM(5, "统计项", 84497),
|
||||
TAX(6, "税费项", 84498),
|
||||
OTHER(7, "其他项", 84499);
|
||||
|
||||
private int value;
|
||||
|
||||
private String defaultLabel;
|
||||
|
||||
private int labelId;
|
||||
|
||||
SalaryItemCategoryEnum(int value, String defaultLabel, int labelId) {
|
||||
this.value = value;
|
||||
this.defaultLabel = defaultLabel;
|
||||
this.labelId = labelId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDefaultLabel() {
|
||||
return defaultLabel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getLabelId() {
|
||||
return labelId;
|
||||
}
|
||||
|
||||
public static SalaryItemCategoryEnum parseByValue(int value) {
|
||||
for (SalaryItemCategoryEnum categoryEnum : SalaryItemCategoryEnum.values()) {
|
||||
if (Objects.equals(categoryEnum.getValue(), value)) {
|
||||
return categoryEnum;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,81 @@
|
|||
package com.engine.salary.enums;
|
||||
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @description: 薪资项目类型
|
||||
* @author: xiajun
|
||||
* @modified By: xiajun
|
||||
* @date: Created in 10/25/21 2:34 PM
|
||||
* @version:v1.0
|
||||
*/
|
||||
public enum SalaryItemTypeEnum implements BaseEnum<Integer> {
|
||||
|
||||
SALARY(1, SalaryItemCategoryEnum.PRE_TAX_ADD, "工资薪金", 85818),
|
||||
BONUS(2, SalaryItemCategoryEnum.PRE_TAX_ADD, "全年一次性奖金", 85820),
|
||||
INTEREST_DIVIDEND(3, SalaryItemCategoryEnum.PRE_TAX_ADD, "利息股息红利", 85821),
|
||||
LABOR_REMUNERATION(4, SalaryItemCategoryEnum.PRE_TAX_ADD, "劳务报酬", 85822),
|
||||
REMUNERATION(5, SalaryItemCategoryEnum.PRE_TAX_ADD, "稿酬", 85823),
|
||||
ROYALTIES(6, SalaryItemCategoryEnum.PRE_TAX_ADD, "特许权使用费", 85824),
|
||||
ACCIDENTAL_INCOME(7, SalaryItemCategoryEnum.PRE_TAX_ADD, "偶然所得", 85825),
|
||||
SEVERANCE_COMPENSATION(8, SalaryItemCategoryEnum.PRE_TAX_ADD, "离职补偿金", 85826),
|
||||
PRE_TAX_DEDUCTION(9, SalaryItemCategoryEnum.PRE_TAX_DUD, "税前扣款", 85828),
|
||||
SPECIAL_DEDUCTION(10, SalaryItemCategoryEnum.PRE_TAX_DUD, "专项扣除", 85829),
|
||||
SPECIAL_ADDITIONAL_DEDUCTION(11, SalaryItemCategoryEnum.PRE_TAX_DUD, "专项附加扣除", 85830),
|
||||
OTHER_DEDUCTIONS(12, SalaryItemCategoryEnum.PRE_TAX_DUD, "其他扣除", 85831),
|
||||
AFTER_TAX_REIMBURSEMENT(13, SalaryItemCategoryEnum.AFTER_TAX_ADD, "税后报销", 85832),
|
||||
AFTER_TAX_ADJUSTMENT(14, SalaryItemCategoryEnum.AFTER_TAX_ADD, "税后调整", 85833),
|
||||
AFTER_TAX_DEDUCTION(15, SalaryItemCategoryEnum.AFTER_TAX_DUD, "税后扣款", 85834),
|
||||
TAX(16, SalaryItemCategoryEnum.TAX, "税费", 85835),
|
||||
EMPLOYEE_INFO(18, SalaryItemCategoryEnum.OTHER, "员工基本信息", 85366),
|
||||
ATTEND_INFO(20, SalaryItemCategoryEnum.OTHER, "员工考勤信息", 98890),
|
||||
OTHER(19, SalaryItemCategoryEnum.OTHER, "其他数值", 100114),
|
||||
TEXT(17, SalaryItemCategoryEnum.OTHER, "其他文本", 100115),
|
||||
OTHER_LOGIC(21, SalaryItemCategoryEnum.OTHER, "其他逻辑", 100116),
|
||||
STATISTICAL_ITEM(22, SalaryItemCategoryEnum.SUM, "统计项", 84497),
|
||||
;
|
||||
|
||||
private int value;
|
||||
|
||||
private SalaryItemCategoryEnum category;
|
||||
|
||||
private String defaultLabel;
|
||||
|
||||
private int labelId;
|
||||
|
||||
SalaryItemTypeEnum(int value, SalaryItemCategoryEnum category, String defaultLabel, int labelId) {
|
||||
this.value = value;
|
||||
this.category = category;
|
||||
this.defaultLabel = defaultLabel;
|
||||
this.labelId = labelId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public SalaryItemCategoryEnum getCategory() {
|
||||
return category;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDefaultLabel() {
|
||||
return defaultLabel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getLabelId() {
|
||||
return labelId;
|
||||
}
|
||||
|
||||
public static SalaryItemTypeEnum parseByValue(int value) {
|
||||
for (SalaryItemTypeEnum salaryItemTypeEnum : SalaryItemTypeEnum.values()) {
|
||||
if (Objects.equals(salaryItemTypeEnum.getValue(), value)) {
|
||||
return salaryItemTypeEnum;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
package com.engine.salary.enums;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @description: 是、否
|
||||
* @author: xiajun
|
||||
* @modified By: xiajun
|
||||
* @date: Created in 10/28/21 5:50 PM
|
||||
* @version:v1.0
|
||||
*/
|
||||
public enum SalaryOnOffEnum implements BaseEnum<Integer> {
|
||||
|
||||
ON(1, "是", 84967),
|
||||
OFF(0, "否", 84968);
|
||||
|
||||
private int value;
|
||||
|
||||
private String defaultLabel;
|
||||
|
||||
private int labelId;
|
||||
|
||||
SalaryOnOffEnum(int value, String defaultLabel, int labelId) {
|
||||
this.value = value;
|
||||
this.defaultLabel = defaultLabel;
|
||||
this.labelId = labelId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDefaultLabel() {
|
||||
return defaultLabel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getLabelId() {
|
||||
return labelId;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,56 @@
|
|||
package com.engine.salary.enums;
|
||||
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @description: 进位规则
|
||||
* @author: xiajun
|
||||
* @modified By: xiajun
|
||||
* @date: Created in 10/25/21 2:46 PM
|
||||
* @version:v1.0
|
||||
*/
|
||||
public enum SalaryRoundingModeEnum implements BaseEnum<Integer> {
|
||||
|
||||
RAW_DATA(1, "原始数据", 84504),
|
||||
ROUNDING(2, "四舍五入", 84505),
|
||||
ROUND_UP(3, "向上舍入", 84506),
|
||||
ROUND_DOWN(4, "向下舍入", 84507),
|
||||
;
|
||||
|
||||
private int value;
|
||||
|
||||
private String defaultLabel;
|
||||
|
||||
private int labelId;
|
||||
|
||||
SalaryRoundingModeEnum(int value, String defaultLabel, int labelId) {
|
||||
this.value = value;
|
||||
this.defaultLabel = defaultLabel;
|
||||
this.labelId = labelId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDefaultLabel() {
|
||||
return defaultLabel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getLabelId() {
|
||||
return labelId;
|
||||
}
|
||||
|
||||
public static SalaryRoundingModeEnum parseByValue(int value) {
|
||||
for (SalaryRoundingModeEnum modeEnum : SalaryRoundingModeEnum.values()) {
|
||||
if (Objects.equals(modeEnum.getValue(), value)) {
|
||||
return modeEnum;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
package com.engine.salary.enums;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @description: 薪资账套设置步骤状态
|
||||
* @author: xiajun
|
||||
* @modified By: xiajun
|
||||
* @date: Created in 11/9/21 3:09 PM
|
||||
* @version:v1.0
|
||||
*/
|
||||
public enum SalarySobStatusEnum implements BaseEnum<Integer> {
|
||||
|
||||
START(0, "开始", 86123),
|
||||
BASIC_INFO(1, "基础信息", 86124),
|
||||
EMPLOYEE_SCOPE(2, "人员范围", 86125),
|
||||
SALARY_ITEM(3, "薪资项目", 84960),
|
||||
CHECK_RULE(4, "校验规则", 86126),
|
||||
END(99, "结束", 86127);
|
||||
|
||||
private int value;
|
||||
|
||||
private String defaultLabel;
|
||||
|
||||
private int labelId;
|
||||
|
||||
SalarySobStatusEnum(int value, String defaultLabel, int labelId) {
|
||||
this.value = value;
|
||||
this.defaultLabel = defaultLabel;
|
||||
this.labelId = labelId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDefaultLabel() {
|
||||
return defaultLabel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getLabelId() {
|
||||
return labelId;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
package com.engine.salary.enums;
|
||||
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @description: 税率表表单类型
|
||||
* @author: xiajun
|
||||
* @modified By: xiajun
|
||||
* @date: Created in 10/19/21 4:05 PM
|
||||
* @version:v1.0
|
||||
*/
|
||||
public enum SalarySystemTypeEnum implements BaseEnum<Integer> {
|
||||
|
||||
CUSTOM(0, "自定义表单", 83993),
|
||||
SYSTEM(1, "系统表单", 83994),
|
||||
;
|
||||
|
||||
private int value;
|
||||
|
||||
private String defaultLabel;
|
||||
|
||||
private int labelId;
|
||||
|
||||
SalarySystemTypeEnum(int value, String defaultLabel, int labelId) {
|
||||
this.value = value;
|
||||
this.defaultLabel = defaultLabel;
|
||||
this.labelId = labelId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDefaultLabel() {
|
||||
return defaultLabel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getLabelId() {
|
||||
return labelId;
|
||||
}
|
||||
|
||||
public static SalarySystemTypeEnum parseByValue(int value) {
|
||||
for (SalarySystemTypeEnum typeEnum : SalarySystemTypeEnum.values()) {
|
||||
if (Objects.equals(typeEnum.getValue(), value)) {
|
||||
return typeEnum;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
package com.engine.salary.enums;
|
||||
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @description: 字段类型
|
||||
* @author: xiajun
|
||||
* @modified By: xiajun
|
||||
* @date: Created in 11/1/21 4:35 PM
|
||||
* @version:v1.0
|
||||
*/
|
||||
public enum SalaryValueTypeEnum implements BaseEnum<Integer> {
|
||||
|
||||
INPUT(1, "输入", 84976),
|
||||
FORMULA(2, "公式", 84977);
|
||||
|
||||
private int value;
|
||||
|
||||
private String defaultLabel;
|
||||
|
||||
private int labelId;
|
||||
|
||||
SalaryValueTypeEnum(int value, String defaultLabel, int labelId) {
|
||||
this.value = value;
|
||||
this.defaultLabel = defaultLabel;
|
||||
this.labelId = labelId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDefaultLabel() {
|
||||
return defaultLabel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getLabelId() {
|
||||
return labelId;
|
||||
}
|
||||
|
||||
public static SalaryValueTypeEnum parseByValue(int value) {
|
||||
for (SalaryValueTypeEnum salaryValueTypeEnum : SalaryValueTypeEnum.values()) {
|
||||
if (Objects.equals(salaryValueTypeEnum.getValue(), value)) {
|
||||
return salaryValueTypeEnum;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
package com.engine.salary.enums.datacollection;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* @Description: 考勤引用-来源
|
||||
* @Author: wangxiangzhong
|
||||
* @Date: 2021-11-17 14:37
|
||||
*/
|
||||
public enum AttendQuoteFieldSourceTypeEnum {
|
||||
DEFAULT(1, "自定义", 87627),
|
||||
ATTEND(2, "考勤模块", 87626);
|
||||
|
||||
private int value;
|
||||
|
||||
private String defaultLabel;
|
||||
|
||||
private int labelId;
|
||||
|
||||
AttendQuoteFieldSourceTypeEnum(int value, String defaultLabel, int labelId) {
|
||||
this.value = value;
|
||||
this.defaultLabel = defaultLabel;
|
||||
this.labelId = labelId;
|
||||
}
|
||||
|
||||
public int getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public String getDefaultLabel() {
|
||||
return defaultLabel;
|
||||
}
|
||||
|
||||
public int getLabelId() {
|
||||
return labelId;
|
||||
}
|
||||
|
||||
public static String getDefaultLabelByValue(Integer value) {
|
||||
if (value == null) {
|
||||
return "";
|
||||
}
|
||||
AttendQuoteFieldSourceTypeEnum[] enumAry = AttendQuoteFieldSourceTypeEnum.values();
|
||||
for(int i = 0; i < Arrays.asList(enumAry).size(); i++){
|
||||
if (Integer.valueOf(enumAry[i].getValue()).equals(value)) {
|
||||
return enumAry[i].getDefaultLabel();
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public static String getNameByValue(Integer value) {
|
||||
if (value == null) {
|
||||
return "";
|
||||
}
|
||||
AttendQuoteFieldSourceTypeEnum[] enumAry = AttendQuoteFieldSourceTypeEnum.values();
|
||||
for(int i = 0; i < Arrays.asList(enumAry).size(); i++){
|
||||
if (Integer.valueOf(enumAry[i].getValue()).equals(value)) {
|
||||
return enumAry[i].name();
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
package com.engine.salary.enums.datacollection;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* @Description: 考勤引用-来源
|
||||
* @Author: wangxiangzhong
|
||||
* @Date: 2021-11-17 14:37
|
||||
*/
|
||||
public enum AttendQuoteFieldTypeEnum {
|
||||
NUMBER(1, "数值", 87625),
|
||||
TEXT(2, "文本", 85393);
|
||||
|
||||
private int value;
|
||||
|
||||
private String defaultLabel;
|
||||
|
||||
private int labelId;
|
||||
|
||||
AttendQuoteFieldTypeEnum(int value, String defaultLabel, int labelId) {
|
||||
this.value = value;
|
||||
this.defaultLabel = defaultLabel;
|
||||
this.labelId = labelId;
|
||||
}
|
||||
|
||||
public int getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public String getDefaultLabel() {
|
||||
return defaultLabel;
|
||||
}
|
||||
|
||||
public int getLabelId() {
|
||||
return labelId;
|
||||
}
|
||||
|
||||
public static String getDefaultLabelByValue(Integer value) {
|
||||
if (value == null) {
|
||||
return "";
|
||||
}
|
||||
AttendQuoteFieldTypeEnum[] enumAry = AttendQuoteFieldTypeEnum.values();
|
||||
for(int i = 0; i < Arrays.asList(enumAry).size(); i++){
|
||||
if (Integer.valueOf(enumAry[i].getValue()).equals(value)) {
|
||||
return enumAry[i].getDefaultLabel();
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
package com.engine.salary.enums.datacollection;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* @Description: 考勤引用-来源
|
||||
* @Author: wangxiangzhong
|
||||
* @Date: 2021-11-17 14:37
|
||||
*/
|
||||
public enum AttendQuoteSourceTypeEnum {
|
||||
QUOTE(1, "引用", 87621),
|
||||
IMPORT(2, "导入", 87622);
|
||||
|
||||
private int value;
|
||||
|
||||
private String defaultLabel;
|
||||
|
||||
private int labelId;
|
||||
|
||||
AttendQuoteSourceTypeEnum(int value, String defaultLabel, int labelId) {
|
||||
this.value = value;
|
||||
this.defaultLabel = defaultLabel;
|
||||
this.labelId = labelId;
|
||||
}
|
||||
|
||||
public int getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public String getDefaultLabel() {
|
||||
return defaultLabel;
|
||||
}
|
||||
|
||||
public int getLabelId() {
|
||||
return labelId;
|
||||
}
|
||||
|
||||
public static String getDefaultLabelByValue(Integer value) {
|
||||
if (value == null) {
|
||||
return "";
|
||||
}
|
||||
AttendQuoteSourceTypeEnum[] enumAry = AttendQuoteSourceTypeEnum.values();
|
||||
for(int i = 0; i < Arrays.asList(enumAry).size(); i++){
|
||||
if (Integer.valueOf(enumAry[i].getValue()).equals(value)) {
|
||||
return enumAry[i].getDefaultLabel();
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,56 @@
|
|||
package com.engine.salary.enums.salaryaccounting;
|
||||
|
||||
import com.engine.salary.enums.BaseEnum;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @description: 薪资核算的状态
|
||||
* @author: xiajun
|
||||
* @modified By: xiajun
|
||||
* @date: Created in 12/1/21 3:57 PM
|
||||
* @version:v1.0
|
||||
*/
|
||||
public enum SalaryAcctRecordStatusEnum implements BaseEnum<Integer> {
|
||||
|
||||
NOT_ARCHIVED(1, "未归档", 91870),
|
||||
ARCHIVED(2, "已归档", 91862),
|
||||
DECLARED(3, "已申报", 100119),
|
||||
;
|
||||
|
||||
private int value;
|
||||
|
||||
private String defaultLabel;
|
||||
|
||||
private int labelId;
|
||||
|
||||
SalaryAcctRecordStatusEnum(int value, String defaultLabel, int labelId) {
|
||||
this.value = value;
|
||||
this.defaultLabel = defaultLabel;
|
||||
this.labelId = labelId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getLabelId() {
|
||||
return labelId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDefaultLabel() {
|
||||
return defaultLabel;
|
||||
}
|
||||
|
||||
public static SalaryAcctRecordStatusEnum parseByValue(Integer value) {
|
||||
for (SalaryAcctRecordStatusEnum salaryAcctRecordStatusEnum : SalaryAcctRecordStatusEnum.values()) {
|
||||
if (Objects.equals(salaryAcctRecordStatusEnum.getValue(), value)) {
|
||||
return salaryAcctRecordStatusEnum;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
package com.engine.salary.enums.salaryarchive;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* @Description: 个税扣缴义务人报税登记状态
|
||||
* @Author: wangxiangzhong
|
||||
* @Date: 2021/10/29 14:06
|
||||
*/
|
||||
public enum IndividualTaxWithholdingAgentStatusEnum {
|
||||
|
||||
UN_VALIDATE(0, "未校验", 85255),
|
||||
VALIDATE_SUCCESS(1, "校验成功", 85256),
|
||||
VALIDATE_FAIL(2, "校验失败", 85257);
|
||||
|
||||
private int value;
|
||||
|
||||
private String defaultLabel;
|
||||
|
||||
private int labelId;
|
||||
|
||||
IndividualTaxWithholdingAgentStatusEnum(int value, String defaultLabel, int labelId) {
|
||||
this.value = value;
|
||||
this.defaultLabel = defaultLabel;
|
||||
this.labelId = labelId;
|
||||
}
|
||||
|
||||
public int getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public String getDefaultLabel() {
|
||||
return defaultLabel;
|
||||
}
|
||||
|
||||
public int getLabelId() {
|
||||
return labelId;
|
||||
}
|
||||
|
||||
public static String getDefaultLabelByValue(Integer value) {
|
||||
if (value == null) {
|
||||
return "";
|
||||
}
|
||||
IndividualTaxWithholdingAgentStatusEnum[] enumAry = IndividualTaxWithholdingAgentStatusEnum.values();
|
||||
for(int i = 0; i < Arrays.asList(enumAry).size(); i++){
|
||||
if (Integer.valueOf(enumAry[i].getValue()).equals(value)) {
|
||||
return enumAry[i].getDefaultLabel();
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
package com.engine.salary.enums.salaryarchive;
|
||||
|
||||
/**
|
||||
* @Description: 已离职时段
|
||||
* @Author: wangxiangzhong
|
||||
* @Date: 2021/12/13 18:56
|
||||
*/
|
||||
public enum SalaryArchiveDimissionTimeIntervalEnum {
|
||||
|
||||
HALFMONTH("HALFMONTH", "半个月", 93335),
|
||||
ONEMONTH("ONEMONTH", "一个月", 93336),
|
||||
TWOMONTH("TWOMONTH", "两个月", 93337),
|
||||
THREEMONTH("THREEMONTH", "三个月", 93338),
|
||||
FOURMONTH("FOURMONTH", "四个月", 93339),
|
||||
FIVEMONTH("FIVEMONTH", "五个月", 93340),
|
||||
HALFYEAR("HALFYEAR", "半年", 93341);
|
||||
|
||||
private String value;
|
||||
|
||||
private String defaultLabel;
|
||||
|
||||
private int labelId;
|
||||
|
||||
SalaryArchiveDimissionTimeIntervalEnum(String value, String defaultLabel, int labelId) {
|
||||
this.value = value;
|
||||
this.defaultLabel = defaultLabel;
|
||||
this.labelId = labelId;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public String getDefaultLabel() {
|
||||
return defaultLabel;
|
||||
}
|
||||
|
||||
public int getLabelId() {
|
||||
return labelId;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
package com.engine.salary.enums.salaryarchive;
|
||||
|
||||
/**
|
||||
* @Description: 薪资档案导入类型
|
||||
* @Author: wangxiangzhong
|
||||
* @Date: 2021/12/24 9:11
|
||||
*/
|
||||
public enum SalaryArchiveImportTypeEnum {
|
||||
|
||||
SALARYITEMADJUST("salaryItemAdjust", "调薪", 85985),
|
||||
TAXAGENTADJUST("taxAgentAdjust", "调整个税扣缴义务人", 93910),
|
||||
INIT("init", "档案初始化", 101600);
|
||||
|
||||
private String value;
|
||||
|
||||
private String defaultLabel;
|
||||
|
||||
private int labelId;
|
||||
|
||||
SalaryArchiveImportTypeEnum(String value, String defaultLabel, int labelId) {
|
||||
this.value = value;
|
||||
this.defaultLabel = defaultLabel;
|
||||
this.labelId = labelId;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public String getDefaultLabel() {
|
||||
return defaultLabel;
|
||||
}
|
||||
|
||||
public int getLabelId() {
|
||||
return labelId;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,56 @@
|
|||
package com.engine.salary.enums.salaryarchive;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* @Description: 薪资档案-薪资项目调整原因
|
||||
* @Author: wangxiangzhong
|
||||
* @Date: 2021/11/1 16:06
|
||||
*/
|
||||
public enum SalaryArchiveItemAdjustReasonEnum {
|
||||
|
||||
ONBOARD("ONBOARD", "入职", 85901),
|
||||
PROBATION_REVIEW("PROBATION_REVIEW", "转正", 85984),
|
||||
SALARY_ADJUSTMENT("SALARY_ADJUSTMENT", "调薪", 85985),
|
||||
POSITION_OR_SALARY_ADJUSTMENT("POSITION_OR_SALARY_ADJUSTMENT", "调岗调薪", 85986),
|
||||
DIMISSION("DIMISSION", "离职", 85902),
|
||||
OTHER("OTHER", "其他", 84500),
|
||||
INIT("INIT", "初始化", 85903);
|
||||
|
||||
private String value;
|
||||
|
||||
private String defaultLabel;
|
||||
|
||||
private int labelId;
|
||||
|
||||
SalaryArchiveItemAdjustReasonEnum(String value, String defaultLabel, int labelId) {
|
||||
this.value = value;
|
||||
this.defaultLabel = defaultLabel;
|
||||
this.labelId = labelId;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public String getDefaultLabel() {
|
||||
return defaultLabel;
|
||||
}
|
||||
|
||||
public int getLabelId() {
|
||||
return labelId;
|
||||
}
|
||||
|
||||
public static String getValueByDefaultLabel(String defaultLabel) {
|
||||
if (defaultLabel == null) {
|
||||
return "";
|
||||
}
|
||||
SalaryArchiveItemAdjustReasonEnum[] enumAry = SalaryArchiveItemAdjustReasonEnum.values();
|
||||
for(int i = 0; i < Arrays.asList(enumAry).size(); i++){
|
||||
if (enumAry[i].getDefaultLabel().equals(defaultLabel)) {
|
||||
return enumAry[i].getValue();
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
package com.engine.salary.enums.salaryarchive;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* @Description: 薪资档案-个税扣缴义务人调整原因
|
||||
* @Author: wangxiangzhong
|
||||
* @Date: 2021/11/1 16:06
|
||||
*/
|
||||
public enum SalaryArchiveTaxAgentAdjustReasonEnum {
|
||||
|
||||
ADJUSTMENT("ADJUSTMENT", "调动", 85899),
|
||||
CHANGE("CHANGE", "变更", 85900),
|
||||
ONBOARD("ONBOARD", "入职", 85901),
|
||||
DIMISSION("DIMISSION", "离职", 85902),
|
||||
OTHER("OTHER", "其他", 84500),
|
||||
INIT("INIT", "初始化", 85903);
|
||||
|
||||
private String value;
|
||||
|
||||
private String defaultLabel;
|
||||
|
||||
private int labelId;
|
||||
|
||||
SalaryArchiveTaxAgentAdjustReasonEnum(String value, String defaultLabel, int labelId) {
|
||||
this.value = value;
|
||||
this.defaultLabel = defaultLabel;
|
||||
this.labelId = labelId;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public String getDefaultLabel() {
|
||||
return defaultLabel;
|
||||
}
|
||||
|
||||
public int getLabelId() {
|
||||
return labelId;
|
||||
}
|
||||
|
||||
public static String getValueByDefaultLabel(String defaultLabel) {
|
||||
if (defaultLabel == null) {
|
||||
return "";
|
||||
}
|
||||
SalaryArchiveTaxAgentAdjustReasonEnum[] enumAry = SalaryArchiveTaxAgentAdjustReasonEnum.values();
|
||||
for(int i = 0; i < Arrays.asList(enumAry).size(); i++){
|
||||
if (enumAry[i].getDefaultLabel().equals(defaultLabel)) {
|
||||
return enumAry[i].getValue();
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
package com.engine.salary.enums.salarybill;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* @Description: 工资单开关项
|
||||
* @Author: wangxiangzhong
|
||||
* @Date: 2021/12/9 15:56
|
||||
*/
|
||||
public enum SalarySendStatusEnum {
|
||||
|
||||
UNSEND(0, "未发放", 93286),
|
||||
ALREADYSEND(1, "已发放", 93212),
|
||||
WITHDRAW(2, "已撤回", 93287);
|
||||
|
||||
private int value;
|
||||
|
||||
private String defaultLabel;
|
||||
|
||||
private int labelId;
|
||||
|
||||
SalarySendStatusEnum(int value, String defaultLabel, int labelId) {
|
||||
this.value = value;
|
||||
this.defaultLabel = defaultLabel;
|
||||
this.labelId = labelId;
|
||||
}
|
||||
|
||||
public Integer getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public String getDefaultLabel() {
|
||||
return defaultLabel;
|
||||
}
|
||||
|
||||
public Integer getLabelId() {
|
||||
return labelId;
|
||||
}
|
||||
|
||||
public static String getDefaultLabelByValue(Integer value) {
|
||||
if (value == null) {
|
||||
return "";
|
||||
}
|
||||
SalarySendStatusEnum[] enumAry = SalarySendStatusEnum.values();
|
||||
for(int i = 0; i < Arrays.asList(enumAry).size(); i++){
|
||||
if (Integer.valueOf(enumAry[i].getValue()).equals(value)) {
|
||||
return enumAry[i].getDefaultLabel();
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public static String getNameByValue(Integer value) {
|
||||
if (value == null) {
|
||||
return "";
|
||||
}
|
||||
SalarySendStatusEnum[] enumAry = SalarySendStatusEnum.values();
|
||||
for(int i = 0; i < Arrays.asList(enumAry).size(); i++){
|
||||
if (Integer.valueOf(enumAry[i].getValue()).equals(value)) {
|
||||
return enumAry[i].name();
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
package com.engine.salary.enums.salarybill;
|
||||
|
||||
/**
|
||||
* @Description: 文本内容位置
|
||||
* @Author: wangxiangzhong
|
||||
* @Date: 2021/12/9 13:22
|
||||
*/
|
||||
public enum SalaryTemplateTextContentPositionEnum {
|
||||
BEFORE(1, "薪资项目前", 92937),
|
||||
AFTER(2, "薪资项目后", 92938);
|
||||
|
||||
private int value;
|
||||
|
||||
private String defaultLabel;
|
||||
|
||||
private int labelId;
|
||||
|
||||
SalaryTemplateTextContentPositionEnum(int value, String defaultLabel, int labelId) {
|
||||
this.value = value;
|
||||
this.defaultLabel = defaultLabel;
|
||||
this.labelId = labelId;
|
||||
}
|
||||
|
||||
public int getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public String getDefaultLabel() {
|
||||
return defaultLabel;
|
||||
}
|
||||
|
||||
public int getLabelId() {
|
||||
return labelId;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
package com.engine.salary.enums.salarybill;
|
||||
|
||||
/**
|
||||
* @Description: 工资单插入变量
|
||||
* @Author: wangxiangzhong
|
||||
* @Date: 2021/12/9 13:13
|
||||
*/
|
||||
public enum SalaryTemplateVarEnum {
|
||||
|
||||
CORPORATENAME("CORPORATENAME", "公司名称", 92936),
|
||||
SALARYYEARMONTH("SALARYYEARMONTH", "薪资所属月", 87614);
|
||||
|
||||
private String value;
|
||||
|
||||
private String defaultLabel;
|
||||
|
||||
private int labelId;
|
||||
|
||||
SalaryTemplateVarEnum(String value, String defaultLabel, int labelId) {
|
||||
this.value = value;
|
||||
this.defaultLabel = defaultLabel;
|
||||
this.labelId = labelId;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public String getDefaultLabel() {
|
||||
return defaultLabel;
|
||||
}
|
||||
|
||||
public int getLabelId() {
|
||||
return labelId;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
package com.engine.salary.enums.salarybill;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* @Description: 工资单开关项
|
||||
* @Author: wangxiangzhong
|
||||
* @Date: 2021/12/9 15:56
|
||||
*/
|
||||
public enum SalaryTemplateWhetherEnum {
|
||||
TRUE(1, "是", 84967),
|
||||
FALSE(0, "否", 84968);
|
||||
|
||||
private int value;
|
||||
|
||||
private String defaultLabel;
|
||||
|
||||
private int labelId;
|
||||
|
||||
SalaryTemplateWhetherEnum(int value, String defaultLabel, int labelId) {
|
||||
this.value = value;
|
||||
this.defaultLabel = defaultLabel;
|
||||
this.labelId = labelId;
|
||||
}
|
||||
|
||||
public Integer getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public String getDefaultLabel() {
|
||||
return defaultLabel;
|
||||
}
|
||||
|
||||
public Integer getLabelId() {
|
||||
return labelId;
|
||||
}
|
||||
|
||||
public static String getNameByValue(Integer value) {
|
||||
if (value == null) {
|
||||
return "";
|
||||
}
|
||||
SalaryTemplateWhetherEnum[] enumAry = SalaryTemplateWhetherEnum.values();
|
||||
for(int i = 0; i < Arrays.asList(enumAry).size(); i++){
|
||||
if (Integer.valueOf(enumAry[i].getValue()).equals(value)) {
|
||||
return enumAry[i].name();
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
package com.engine.salary.enums.salarysob;
|
||||
|
||||
import com.engine.salary.enums.BaseEnum;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @description: 应税项目
|
||||
* @author: xiajun
|
||||
* @modified By: xiajun
|
||||
* @date: Created in 12/18/21 3:20 PM
|
||||
* @version:v1.0
|
||||
*/
|
||||
public enum IncomeCategoryEnum implements BaseEnum<Integer> {
|
||||
|
||||
WAGES_AND_SALARIES(1, "正常工资薪金所得", 98656),
|
||||
|
||||
// 暂时注释掉,后续会开放
|
||||
// ONETIME_ANNUAL_BONUS(2,"全年一次性奖金收入", 0),
|
||||
//
|
||||
// REMUNERATION_FOR_LABOR(4, "劳务报酬所得", 0),
|
||||
//
|
||||
// OTHER(11, "其他所得", 0),
|
||||
;
|
||||
|
||||
private int value;
|
||||
|
||||
private String defaultLabel;
|
||||
|
||||
private int labelId;
|
||||
|
||||
IncomeCategoryEnum(int value, String defaultLabel, int labelId) {
|
||||
this.value = value;
|
||||
this.defaultLabel = defaultLabel;
|
||||
this.labelId = labelId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getLabelId() {
|
||||
return labelId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDefaultLabel() {
|
||||
return defaultLabel;
|
||||
}
|
||||
|
||||
public static IncomeCategoryEnum parseByValue(int value) {
|
||||
for (IncomeCategoryEnum incomeCategoryEnum : IncomeCategoryEnum.values()) {
|
||||
if (Objects.equals(incomeCategoryEnum.getValue(), value)) {
|
||||
return incomeCategoryEnum;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
package com.engine.salary.enums.salarysob;
|
||||
|
||||
|
||||
import com.engine.salary.enums.BaseEnum;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @description:
|
||||
* @author: xiajun
|
||||
* @modified By: xiajun
|
||||
* @date: Created in 11/22/21 5:26 PM
|
||||
* @version:v1.0
|
||||
*/
|
||||
public enum SalaryEmployeeStatusEnum implements BaseEnum<Integer> {
|
||||
|
||||
ALL(0, "全部", 85155),
|
||||
NORMAL(1, "在职", 100120),
|
||||
UNAVAILABLE(2, "离职", 85902),
|
||||
;
|
||||
|
||||
private int value;
|
||||
|
||||
private String defaultLabel;
|
||||
|
||||
private int labelId;
|
||||
|
||||
SalaryEmployeeStatusEnum(int value, String defaultLabel, int labelId) {
|
||||
this.value = value;
|
||||
this.defaultLabel = defaultLabel;
|
||||
this.labelId = labelId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getLabelId() {
|
||||
return labelId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDefaultLabel() {
|
||||
return defaultLabel;
|
||||
}
|
||||
|
||||
public static SalaryEmployeeStatusEnum parseByValue(Integer value) {
|
||||
for (SalaryEmployeeStatusEnum statusEnum : SalaryEmployeeStatusEnum.values()) {
|
||||
if (Objects.equals(statusEnum.getValue(), value)) {
|
||||
return statusEnum;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
package com.engine.salary.enums.salarysob;
|
||||
|
||||
import com.engine.salary.enums.BaseEnum;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @description: 调薪规则
|
||||
* @author: xiajun
|
||||
* @modified By: xiajun
|
||||
* @date: Created in 12/31/21 2:00 PM
|
||||
* @version:v1.0
|
||||
*/
|
||||
public enum SalarySobAdjustRuleTypeEnum implements BaseEnum<Integer> {
|
||||
|
||||
USE_BEFORE_ADJUSTMENT(1,"取调薪前薪资", 100121),
|
||||
USE_AFTER_ADJUSTMENT(2, "取调薪后薪资",100131),
|
||||
AVERAGE(3, "平均值", 100132),
|
||||
PARTITION(4, "分段计薪",97005),
|
||||
;
|
||||
|
||||
SalarySobAdjustRuleTypeEnum(int value, String defaultLabel, int labelId) {
|
||||
this.value = value;
|
||||
this.defaultLabel = defaultLabel;
|
||||
this.labelId = labelId;
|
||||
}
|
||||
|
||||
private int value;
|
||||
|
||||
private String defaultLabel;
|
||||
|
||||
private int labelId;
|
||||
|
||||
@Override
|
||||
public Integer getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getLabelId() {
|
||||
return labelId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDefaultLabel() {
|
||||
return defaultLabel;
|
||||
}
|
||||
|
||||
public static SalarySobAdjustRuleTypeEnum parseByValue(Integer value){
|
||||
for (SalarySobAdjustRuleTypeEnum salarySobAdjustRuleTypeEnum : SalarySobAdjustRuleTypeEnum.values()) {
|
||||
if(Objects.equals(salarySobAdjustRuleTypeEnum.getValue(), value)){
|
||||
return salarySobAdjustRuleTypeEnum;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
package com.engine.salary.enums.salarysob;
|
||||
|
||||
|
||||
import com.engine.salary.enums.BaseEnum;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @description: 人员范围的对象类型
|
||||
* @author: xiajun
|
||||
* @modified By: xiajun
|
||||
* @date: Created in 11/22/21 11:32 AM
|
||||
* @version:v1.0
|
||||
*/
|
||||
public enum TargetTypeEnum implements BaseEnum<Integer> {
|
||||
EMPLOYEE(1, "人员", 100133),
|
||||
DEPT(2, "部门", 86185),
|
||||
POSITION(4, "岗位", 90633),
|
||||
;
|
||||
|
||||
private int value;
|
||||
|
||||
private String defaultLabel;
|
||||
|
||||
private int labelId;
|
||||
|
||||
TargetTypeEnum(int value, String defaultLabel, int labelId) {
|
||||
this.value = value;
|
||||
this.defaultLabel = defaultLabel;
|
||||
this.labelId = labelId;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Integer getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getLabelId() {
|
||||
return labelId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDefaultLabel() {
|
||||
return defaultLabel;
|
||||
}
|
||||
|
||||
public static TargetTypeEnum parseByValue(Integer value) {
|
||||
for (TargetTypeEnum targetTypeEnum : TargetTypeEnum.values()) {
|
||||
if (Objects.equals(targetTypeEnum.getValue(), value)) {
|
||||
return targetTypeEnum;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
package com.engine.salary.enums.siaccount;
|
||||
|
||||
import com.engine.salary.enums.BaseEnum;
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
* @Author: zhangheng
|
||||
* @CreateDate: 2021/12/3 16:23
|
||||
* @Version: v1.0
|
||||
*/
|
||||
public enum BillStatusEnum implements BaseEnum<Integer> {
|
||||
NOT_ARCHIVED(0, "未归档", 91870),
|
||||
|
||||
ARCHIVED(1, "已归档", 91862);
|
||||
|
||||
private Integer value;
|
||||
|
||||
private String defaultLable;
|
||||
|
||||
private Integer labelId;
|
||||
|
||||
BillStatusEnum(Integer value, String defaultLable, Integer labelId) {
|
||||
this.value = value;
|
||||
this.defaultLable = defaultLable;
|
||||
this.labelId = labelId;
|
||||
}
|
||||
|
||||
public Integer getValue() {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
public Integer getLabelId() {
|
||||
return this.labelId;
|
||||
}
|
||||
|
||||
public String getDefaultLabel() {
|
||||
return this.defaultLable;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
package com.engine.salary.enums.siaccount;
|
||||
|
||||
import com.engine.salary.enums.BaseEnum;
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
* @Author: zhangheng
|
||||
* @CreateDate: 2022/1/4 9:13
|
||||
* @Version: v1.0
|
||||
*/
|
||||
public enum InspectStatusEnum implements BaseEnum<Integer> {
|
||||
IGNORE(0, "忽略", 92457),
|
||||
|
||||
COMFORED(1, "重置", 93869);
|
||||
|
||||
private Integer value;
|
||||
|
||||
private String defaultLable;
|
||||
|
||||
private Integer labelId;
|
||||
|
||||
InspectStatusEnum(Integer value, String defaultLable, Integer labelId) {
|
||||
this.value = value;
|
||||
this.defaultLable = defaultLable;
|
||||
this.labelId = labelId;
|
||||
}
|
||||
|
||||
public Integer getValue() {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
public Integer getLabelId() {
|
||||
return this.labelId;
|
||||
}
|
||||
|
||||
public String getDefaultLabel() {
|
||||
return this.defaultLable;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
package com.engine.salary.enums.siaccount;
|
||||
|
||||
|
||||
import com.engine.salary.enums.BaseEnum;
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
* @Author: zhangheng
|
||||
* @CreateDate: 2021/12/6 9:32
|
||||
* @Version: v1.0
|
||||
*/
|
||||
public enum PaymentStatusEnum implements BaseEnum<Integer> {
|
||||
|
||||
COMMON(0, "正常缴纳", 92265),
|
||||
REPAIR(1, "补缴", 92266);
|
||||
|
||||
private Integer value;
|
||||
|
||||
private String defaultLable;
|
||||
|
||||
private Integer labelId;
|
||||
|
||||
PaymentStatusEnum(Integer value, String defaultLable, Integer labelId) {
|
||||
this.value = value;
|
||||
this.defaultLable = defaultLable;
|
||||
this.labelId = labelId;
|
||||
}
|
||||
|
||||
public Integer getValue() {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
public Integer getLabelId() {
|
||||
return this.labelId;
|
||||
}
|
||||
|
||||
public String getDefaultLabel() {
|
||||
return this.defaultLable;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
package com.engine.salary.enums.siaccount;
|
||||
|
||||
import com.engine.salary.enums.BaseEnum;
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
* @Author: zhangheng
|
||||
* @CreateDate: 2021/12/10 13:10
|
||||
* @Version: v1.0
|
||||
*/
|
||||
public enum ProjectTypeEnum implements BaseEnum<Integer> {
|
||||
ALL(0, "全部", 85155),
|
||||
SOCIAL(1, "社保", 86568),
|
||||
FUND(2, "公积金", 86569),
|
||||
OTHER(3, "企业年金及其他福利", 93112),
|
||||
ENDOWMENT_INSURANCE(4, "养老保险", 93113),
|
||||
MEDICAL_INSURANCE(5, "医疗保险", 93114);
|
||||
|
||||
private int value;
|
||||
|
||||
private String defaultLabel;
|
||||
|
||||
private int labelId;
|
||||
|
||||
ProjectTypeEnum(int value, String defaultLabel, int labelId) {
|
||||
this.value = value;
|
||||
this.defaultLabel = defaultLabel;
|
||||
this.labelId = labelId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getLabelId() {
|
||||
return labelId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDefaultLabel() {
|
||||
return defaultLabel;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
package com.engine.salary.enums.siaccount;
|
||||
|
||||
import com.engine.salary.enums.BaseEnum;
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
* @Author: zhangheng
|
||||
* @CreateDate: 2021/12/6 9:37
|
||||
* @Version: v1.0
|
||||
*/
|
||||
public enum ResourceFromEnum implements BaseEnum<Integer> {
|
||||
|
||||
SYSTEM(0, "系统核算", 92268),
|
||||
|
||||
Temporary(1, "临时", 92269);
|
||||
|
||||
private Integer value;
|
||||
|
||||
private String defaultLable;
|
||||
|
||||
private Integer labelId;
|
||||
|
||||
ResourceFromEnum(Integer value, String defaultLable, Integer labelId) {
|
||||
this.value = value;
|
||||
this.defaultLable = defaultLable;
|
||||
this.labelId = labelId;
|
||||
}
|
||||
|
||||
public Integer getValue() {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
public Integer getLabelId() {
|
||||
return this.labelId;
|
||||
}
|
||||
|
||||
public String getDefaultLabel() {
|
||||
return this.defaultLable;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
package com.engine.salary.enums.sicategory;
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
* @Author: zhangheng
|
||||
* @CreateDate: 2021/11/19 14:18
|
||||
* @Version: v1.0
|
||||
*/
|
||||
public enum DataTypeEnum {
|
||||
|
||||
CUSTOM(0, "自定义"),
|
||||
|
||||
SYSTEM(1, "系统");
|
||||
|
||||
private Integer value;
|
||||
|
||||
private String desc;
|
||||
|
||||
DataTypeEnum(Integer value, String desc) {
|
||||
this.value = value;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
public Integer getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
package com.engine.salary.enums.sicategory;
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
* @Author: zhangheng
|
||||
* @CreateDate: 2021/11/19 14:20
|
||||
* @Version: v1.0
|
||||
*/
|
||||
public enum DeleteTypeEnum {
|
||||
|
||||
NOT_DELETED(0, "未删除"),
|
||||
|
||||
DELETED(1, "已删除");
|
||||
|
||||
private Integer value;
|
||||
|
||||
private String desc;
|
||||
|
||||
DeleteTypeEnum(Integer value, String desc) {
|
||||
this.value = value;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
public Integer getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
package com.engine.salary.enums.sicategory;
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
* @Author: zhangheng
|
||||
* @CreateDate: 2021/12/2 9:26
|
||||
* @Version: v1.0
|
||||
*/
|
||||
public enum IncludeTypeEnum {
|
||||
INCLUDE(1, "包含"),
|
||||
EXCLUDE(0, "不包含");
|
||||
private Integer value;
|
||||
|
||||
private String desc;
|
||||
|
||||
IncludeTypeEnum(Integer value, String desc) {
|
||||
this.value = value;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
public Integer getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
package com.engine.salary.enums.sicategory;
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
* @Author: zhangheng
|
||||
* @CreateDate: 2021/11/18 13:29
|
||||
* @Version: v1.0
|
||||
*/
|
||||
public enum IsPaymentEnum {
|
||||
YES(1, "缴费"),
|
||||
|
||||
NO(0, "不缴费");
|
||||
|
||||
private Integer value;
|
||||
private String desc;
|
||||
|
||||
IsPaymentEnum(Integer value, String desc) {
|
||||
this.value = value;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
public Integer getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
package com.engine.salary.enums.sicategory;
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
* @Author: zhangheng
|
||||
* @CreateDate: 2021/11/19 14:24
|
||||
* @Version: v1.0
|
||||
*/
|
||||
public enum IsUseEnum {
|
||||
START(1, "启用"),
|
||||
|
||||
STOP(0, "停用");
|
||||
|
||||
private Integer value;
|
||||
|
||||
private String desc;
|
||||
|
||||
IsUseEnum(Integer value, String desc) {
|
||||
this.value = value;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
public Integer getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
package com.engine.salary.enums.sicategory;
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
* @Author: zhangheng
|
||||
* @CreateDate: 2021/11/29 9:24
|
||||
* @Version: v1.0
|
||||
*/
|
||||
public enum NonPaymentEnum {
|
||||
|
||||
YES(0, "缴纳"),
|
||||
|
||||
NO(1, "不缴纳");
|
||||
|
||||
private Integer value;
|
||||
|
||||
private String desc;
|
||||
|
||||
NonPaymentEnum(Integer value, String desc) {
|
||||
this.value = value;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
public Integer getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
package com.engine.salary.enums.sicategory;
|
||||
|
||||
|
||||
import com.engine.salary.enums.BaseEnum;
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
* @Author: zhangheng
|
||||
* @CreateDate: 2021/11/15 14:54
|
||||
* @Version: v1.0
|
||||
*/
|
||||
public enum PaymentScopeEnum implements BaseEnum<Integer> {
|
||||
SCOPE_COMPANY(1, "公司", 87158),
|
||||
SCOPE_PERSON(2, "个人", 87159);
|
||||
|
||||
private Integer value;
|
||||
private String defaultLable;
|
||||
private Integer labelId;
|
||||
|
||||
PaymentScopeEnum(Integer value, String defaultLable, Integer labelId) {
|
||||
this.value = value;
|
||||
this.defaultLable = defaultLable;
|
||||
this.labelId = labelId;
|
||||
}
|
||||
|
||||
public Integer getValue() {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
public Integer getLabelId() {
|
||||
return this.labelId;
|
||||
}
|
||||
|
||||
public String getDefaultLabel() {
|
||||
return this.defaultLable;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
package com.engine.salary.enums.sicategory;
|
||||
|
||||
import com.engine.salary.enums.BaseEnum;
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
* @Author: zhangheng
|
||||
* @CreateDate: 2021/11/16 13:11
|
||||
* @Version: v1.0
|
||||
*/
|
||||
public enum PaymentTypeEnum implements BaseEnum<Integer> {
|
||||
SCHEME_TOWN(1, "城镇", 87410),
|
||||
SCHEME_VILLAGE(2, "农村", 87411);
|
||||
|
||||
private Integer value;
|
||||
|
||||
private String defaultLabel;
|
||||
|
||||
private Integer labelId;
|
||||
|
||||
PaymentTypeEnum(Integer value, String defaultLabel, Integer labelId) {
|
||||
this.value = value;
|
||||
this.defaultLabel = defaultLabel;
|
||||
this.labelId = labelId;
|
||||
}
|
||||
|
||||
public Integer getValue() {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
public Integer getLabelId() {
|
||||
return this.labelId;
|
||||
}
|
||||
|
||||
public String getDefaultLabel() {
|
||||
return this.defaultLabel;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
package com.engine.salary.enums.sicategory;
|
||||
|
||||
|
||||
import com.engine.salary.enums.BaseEnum;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @Description: 进位规则枚举
|
||||
* @Author: zhangheng
|
||||
* @CreateDate: 2021/11/16 14:43
|
||||
* @Version: v1.0
|
||||
*/
|
||||
public enum RententionRuleEnum implements BaseEnum<Integer> {
|
||||
ROUND(BigDecimal.ROUND_HALF_UP, "四舍五入", 84505),
|
||||
CEIL(BigDecimal.ROUND_UP, "向上舍入", 84506),
|
||||
FLOOR(BigDecimal.ROUND_DOWN, "向下舍入", 84507);
|
||||
|
||||
private int value;
|
||||
|
||||
private String defaultLabel;
|
||||
|
||||
private int lavelId;
|
||||
|
||||
RententionRuleEnum(int value, String defaultLabel, int labelId) {
|
||||
this.value = value;
|
||||
this.defaultLabel = defaultLabel;
|
||||
this.lavelId = labelId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getValue() {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getLabelId() {
|
||||
return this.lavelId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDefaultLabel() {
|
||||
return this.defaultLabel;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
package com.engine.salary.enums.sicategory;
|
||||
|
||||
import com.engine.salary.enums.BaseEnum;
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
* @Author: zhangheng
|
||||
* @CreateDate: 2021/11/25 16:43
|
||||
* @Version: v1.0
|
||||
*/
|
||||
public enum UndertakerEnum implements BaseEnum<Integer> {
|
||||
|
||||
SCOPE_COMPANY(1, "公司", 87158),
|
||||
SCOPE_PERSON(2, "个人", 87159);
|
||||
|
||||
private Integer value;
|
||||
|
||||
private String defaultLable;
|
||||
|
||||
private Integer labelId;
|
||||
|
||||
UndertakerEnum(Integer value, String defaultLable, Integer labelId) {
|
||||
this.value = value;
|
||||
this.defaultLable = defaultLable;
|
||||
this.labelId = labelId;
|
||||
}
|
||||
|
||||
public Integer getValue() {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
public Integer getLabelId() {
|
||||
return this.labelId;
|
||||
}
|
||||
|
||||
public String getDefaultLabel() {
|
||||
return this.defaultLable;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
package com.engine.salary.enums.sicategory;
|
||||
|
||||
import com.engine.salary.enums.BaseEnum;
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
* @Author: zhangheng
|
||||
* @CreateDate: 2021/11/11 19:05
|
||||
* @Version: v1.0
|
||||
*/
|
||||
public enum WelfareTypeEnum implements BaseEnum<Integer> {
|
||||
SOCIAL_SECURITY(1, "社保", 86568),
|
||||
ACCUMULATION_FUND(2, "公积金", 86569),
|
||||
OTHER(3, "企业年金及其它福利", 86570);
|
||||
|
||||
private Integer value;
|
||||
|
||||
private String defaultLabel;
|
||||
|
||||
private Integer labelId;
|
||||
|
||||
WelfareTypeEnum(Integer value, String defaultLabel, Integer labelId) {
|
||||
this.value = value;
|
||||
this.defaultLabel = defaultLabel;
|
||||
this.labelId = labelId;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Integer getValue() {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getLabelId() {
|
||||
return this.labelId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDefaultLabel() {
|
||||
return this.defaultLabel;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,76 @@
|
|||
package com.engine.salary.mapper;
|
||||
|
||||
import com.engine.salary.entity.taxrate.SysTaxRateBase;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface SysTaxRateBaseMapper {
|
||||
|
||||
/**
|
||||
* 查询所有记录
|
||||
*
|
||||
* @return 返回集合,没有返回空List
|
||||
*/
|
||||
List<SysTaxRateBase> listAll();
|
||||
|
||||
|
||||
/**
|
||||
* 根据主键查询
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 返回记录,没有返回null
|
||||
*/
|
||||
SysTaxRateBase getById(Long id);
|
||||
|
||||
/**
|
||||
* 新增,插入所有字段
|
||||
*
|
||||
* @param sysTaxRateBase 新增的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int insert(SysTaxRateBase sysTaxRateBase);
|
||||
|
||||
/**
|
||||
* 新增,忽略null字段
|
||||
*
|
||||
* @param sysTaxRateBase 新增的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int insertIgnoreNull(SysTaxRateBase sysTaxRateBase);
|
||||
|
||||
/**
|
||||
* 修改,修改所有字段
|
||||
*
|
||||
* @param sysTaxRateBase 修改的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int update(SysTaxRateBase sysTaxRateBase);
|
||||
|
||||
/**
|
||||
* 修改,忽略null字段
|
||||
*
|
||||
* @param sysTaxRateBase 修改的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int updateIgnoreNull(SysTaxRateBase sysTaxRateBase);
|
||||
|
||||
/**
|
||||
* 删除记录
|
||||
*
|
||||
* @param sysTaxRateBase 待删除的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int delete(SysTaxRateBase sysTaxRateBase);
|
||||
|
||||
List<SysTaxRateBase> selectByIds(@Param("ids") Collection<Long> ids);
|
||||
|
||||
/**
|
||||
* 条件查询
|
||||
*/
|
||||
List<SysTaxRateBase> listBySome(@Param("param") SysTaxRateBase param);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,232 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.engine.salary.mapper.SysTaxRateBaseMapper">
|
||||
<resultMap id="BaseResultMap" type="com.engine.salary.entity.taxrate.SysTaxRateBase">
|
||||
<result column="create_time" property="createTime"/>
|
||||
<result column="creator" property="creator"/>
|
||||
<result column="delete_type" property="deleteType"/>
|
||||
<result column="description" property="description"/>
|
||||
<result column="id" property="id"/>
|
||||
<result column="name" property="name"/>
|
||||
<result column="system_type" property="systemType"/>
|
||||
<result column="tenant_key" property="tenantKey"/>
|
||||
<result column="update_time" property="updateTime"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 表字段 -->
|
||||
<sql id="baseColumns">
|
||||
t
|
||||
.
|
||||
create_time
|
||||
, t.creator
|
||||
, t.delete_type
|
||||
, t.description
|
||||
, t.id
|
||||
, t.name
|
||||
, t.system_type
|
||||
, t.tenant_key
|
||||
, t.update_time
|
||||
</sql>
|
||||
|
||||
<sql id="paramSql">
|
||||
<if test="param.ids != null and param.ids.size()>0">
|
||||
AND id IN
|
||||
<foreach collection="param.ids" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="param.name != null and param.name != ''">
|
||||
AND name = #{param.name}
|
||||
</if>
|
||||
</sql>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="listAll" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="baseColumns"/>
|
||||
FROM hrsa_sys_tax_rate_base t
|
||||
WHERE delete_type = 0
|
||||
</select>
|
||||
|
||||
<!-- 根据主键获取单条记录 -->
|
||||
<select id="getById" resultMap="BaseResultMap" parameterType="Long">
|
||||
SELECT
|
||||
<include refid="baseColumns"/>
|
||||
FROM hrsa_sys_tax_rate_base t
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</select>
|
||||
|
||||
<!-- 插入全部字段 -->
|
||||
<insert id="insert" parameterType="com.engine.salary.entity.taxrate.SysTaxRateBase"
|
||||
keyProperty="id" keyColumn="id" useGeneratedKeys="true"
|
||||
>
|
||||
INSERT INTO hrsa_sys_tax_rate_base
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
create_time,
|
||||
creator,
|
||||
delete_type,
|
||||
description,
|
||||
id,
|
||||
name,
|
||||
system_type,
|
||||
tenant_key,
|
||||
update_time,
|
||||
</trim>
|
||||
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
||||
#{createTime},
|
||||
#{creator},
|
||||
#{deleteType},
|
||||
#{description},
|
||||
#{id},
|
||||
#{name},
|
||||
#{systemType},
|
||||
#{tenantKey},
|
||||
#{updateTime},
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<!-- 插入不为NULL的字段 -->
|
||||
<insert id="insertIgnoreNull" parameterType="com.engine.salary.entity.taxrate.SysTaxRateBase"
|
||||
keyProperty="id" keyColumn="id" useGeneratedKeys="true"
|
||||
>
|
||||
INSERT INTO hrsa_sys_tax_rate_base
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
creator,
|
||||
</if>
|
||||
<if test="deleteType != null">
|
||||
delete_type,
|
||||
</if>
|
||||
<if test="description != null">
|
||||
description,
|
||||
</if>
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="name != null">
|
||||
name,
|
||||
</if>
|
||||
<if test="systemType != null">
|
||||
system_type,
|
||||
</if>
|
||||
<if test="tenantKey != null">
|
||||
tenant_key,
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
||||
<if test="createTime != null">
|
||||
#{createTime},
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
#{creator},
|
||||
</if>
|
||||
<if test="deleteType != null">
|
||||
#{deleteType},
|
||||
</if>
|
||||
<if test="description != null">
|
||||
#{description},
|
||||
</if>
|
||||
<if test="id != null">
|
||||
#{id},
|
||||
</if>
|
||||
<if test="name != null">
|
||||
#{name},
|
||||
</if>
|
||||
<if test="systemType != null">
|
||||
#{systemType},
|
||||
</if>
|
||||
<if test="tenantKey != null">
|
||||
#{tenantKey},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
#{updateTime},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<!-- 更新,更新全部字段 -->
|
||||
<update id="update" parameterType="com.engine.salary.entity.taxrate.SysTaxRateBase">
|
||||
UPDATE hrsa_sys_tax_rate_base
|
||||
<set>
|
||||
create_time=#{createTime},
|
||||
creator=#{creator},
|
||||
delete_type=#{deleteType},
|
||||
description=#{description},
|
||||
name=#{name},
|
||||
system_type=#{systemType},
|
||||
tenant_key=#{tenantKey},
|
||||
update_time=#{updateTime},
|
||||
</set>
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</update>
|
||||
|
||||
|
||||
<!-- 更新不为NULL的字段 -->
|
||||
<update id="updateIgnoreNull" parameterType="com.engine.salary.entity.taxrate.SysTaxRateBase">
|
||||
UPDATE hrsa_sys_tax_rate_base
|
||||
<set>
|
||||
<if test="createTime != null">
|
||||
create_time=#{createTime},
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
creator=#{creator},
|
||||
</if>
|
||||
<if test="deleteType != null">
|
||||
delete_type=#{deleteType},
|
||||
</if>
|
||||
<if test="description != null">
|
||||
description=#{description},
|
||||
</if>
|
||||
<if test="name != null">
|
||||
name=#{name},
|
||||
</if>
|
||||
<if test="systemType != null">
|
||||
system_type=#{systemType},
|
||||
</if>
|
||||
<if test="tenantKey != null">
|
||||
tenant_key=#{tenantKey},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time=#{updateTime},
|
||||
</if>
|
||||
</set>
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</update>
|
||||
|
||||
|
||||
<!-- 根据主键删除记录 -->
|
||||
<delete id="delete" parameterType="com.engine.salary.entity.taxrate.SysTaxRateBase">
|
||||
UPDATE hrsa_sys_tax_rate_base
|
||||
SET delete_type=1
|
||||
WHERE id = #{id}
|
||||
AND delete_type = 0
|
||||
</delete>
|
||||
|
||||
<select id="selectByIds" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="baseColumns"/>
|
||||
FROM hrsa_sys_tax_rate_base
|
||||
WHERE delete_type = 0
|
||||
<include refid="paramSql"/>
|
||||
ORDER BY id DESC
|
||||
</select>
|
||||
|
||||
|
||||
<select id="listBySome" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="baseColumns"/>
|
||||
FROM hrsa_sys_tax_rate_base t
|
||||
WHERE delete_type = 0
|
||||
<include refid="paramSql"/>
|
||||
ORDER BY id DESC
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,81 @@
|
|||
package com.engine.salary.mapper;
|
||||
|
||||
import com.engine.salary.entity.taxrate.TaxRateBase;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface TaxRateBaseMapper {
|
||||
|
||||
/**
|
||||
* 查询所有记录
|
||||
*
|
||||
* @return 返回集合,没有返回空List
|
||||
*/
|
||||
List<TaxRateBase> listAll();
|
||||
|
||||
|
||||
/**
|
||||
* 根据主键查询
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 返回记录,没有返回null
|
||||
*/
|
||||
TaxRateBase getById(Long id);
|
||||
|
||||
/**
|
||||
* 新增,插入所有字段
|
||||
*
|
||||
* @param taxRateBase 新增的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int insert(TaxRateBase taxRateBase);
|
||||
|
||||
/**
|
||||
* 新增,忽略null字段
|
||||
*
|
||||
* @param taxRateBase 新增的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int insertIgnoreNull(TaxRateBase taxRateBase);
|
||||
|
||||
/**
|
||||
* 修改,修改所有字段
|
||||
*
|
||||
* @param taxRateBase 修改的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int update(TaxRateBase taxRateBase);
|
||||
|
||||
/**
|
||||
* 修改,忽略null字段
|
||||
*
|
||||
* @param taxRateBase 修改的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int updateIgnoreNull(TaxRateBase taxRateBase);
|
||||
|
||||
/**
|
||||
* 删除记录
|
||||
*
|
||||
* @param taxRateBase 待删除的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int delete(TaxRateBase taxRateBase);
|
||||
|
||||
|
||||
|
||||
List<TaxRateBase> selectByIds(@Param("ids") Collection<Long> ids);
|
||||
|
||||
/**
|
||||
* 条件查询
|
||||
* @return
|
||||
*/
|
||||
List<TaxRateBase> listBySome(@Param("param") TaxRateBase param);
|
||||
|
||||
void deleteByIds(@Param("ids") Collection<Long> ids);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,242 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.engine.salary.mapper.TaxRateBaseMapper">
|
||||
<resultMap id="BaseResultMap" type="com.engine.salary.entity.taxrate.TaxRateBase">
|
||||
<result column="create_time" property="createTime"/>
|
||||
<result column="creator" property="creator"/>
|
||||
<result column="delete_type" property="deleteType"/>
|
||||
<result column="description" property="description"/>
|
||||
<result column="id" property="id"/>
|
||||
<result column="name" property="name"/>
|
||||
<result column="system_type" property="systemType"/>
|
||||
<result column="tenant_key" property="tenantKey"/>
|
||||
<result column="update_time" property="updateTime"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 表字段 -->
|
||||
<sql id="baseColumns">
|
||||
t
|
||||
.
|
||||
create_time
|
||||
, t.creator
|
||||
, t.delete_type
|
||||
, t.description
|
||||
, t.id
|
||||
, t.name
|
||||
, t.system_type
|
||||
, t.tenant_key
|
||||
, t.update_time
|
||||
</sql>
|
||||
|
||||
<sql id="paramSql">
|
||||
<if test="param.ids != null and param.ids.size()>0">
|
||||
AND id IN
|
||||
<foreach collection="param.ids" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="param.name != null and param.name != ''">
|
||||
AND name like CONCAT('%',#{param.name},'%')
|
||||
</if>
|
||||
</sql>
|
||||
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="listAll" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="baseColumns"/>
|
||||
FROM hrsa_tax_rate_base t
|
||||
WHERE delete_type = 0
|
||||
</select>
|
||||
|
||||
<!-- 根据主键获取单条记录 -->
|
||||
<select id="getById" resultMap="BaseResultMap" parameterType="Long">
|
||||
SELECT
|
||||
<include refid="baseColumns"/>
|
||||
FROM hrsa_tax_rate_base t
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</select>
|
||||
|
||||
<!-- 插入全部字段 -->
|
||||
<insert id="insert" parameterType="com.engine.salary.entity.taxrate.TaxRateBase"
|
||||
keyProperty="id" keyColumn="id" useGeneratedKeys="true"
|
||||
>
|
||||
INSERT INTO hrsa_tax_rate_base
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
create_time,
|
||||
creator,
|
||||
delete_type,
|
||||
description,
|
||||
id,
|
||||
name,
|
||||
system_type,
|
||||
tenant_key,
|
||||
update_time,
|
||||
</trim>
|
||||
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
||||
#{createTime},
|
||||
#{creator},
|
||||
#{deleteType},
|
||||
#{description},
|
||||
#{id},
|
||||
#{name},
|
||||
#{systemType},
|
||||
#{tenantKey},
|
||||
#{updateTime},
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<!-- 插入不为NULL的字段 -->
|
||||
<insert id="insertIgnoreNull" parameterType="com.engine.salary.entity.taxrate.TaxRateBase"
|
||||
keyProperty="id" keyColumn="id" useGeneratedKeys="true"
|
||||
>
|
||||
INSERT INTO hrsa_tax_rate_base
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
creator,
|
||||
</if>
|
||||
<if test="deleteType != null">
|
||||
delete_type,
|
||||
</if>
|
||||
<if test="description != null">
|
||||
description,
|
||||
</if>
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="name != null">
|
||||
name,
|
||||
</if>
|
||||
<if test="systemType != null">
|
||||
system_type,
|
||||
</if>
|
||||
<if test="tenantKey != null">
|
||||
tenant_key,
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
||||
<if test="createTime != null">
|
||||
#{createTime},
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
#{creator},
|
||||
</if>
|
||||
<if test="deleteType != null">
|
||||
#{deleteType},
|
||||
</if>
|
||||
<if test="description != null">
|
||||
#{description},
|
||||
</if>
|
||||
<if test="id != null">
|
||||
#{id},
|
||||
</if>
|
||||
<if test="name != null">
|
||||
#{name},
|
||||
</if>
|
||||
<if test="systemType != null">
|
||||
#{systemType},
|
||||
</if>
|
||||
<if test="tenantKey != null">
|
||||
#{tenantKey},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
#{updateTime},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<!-- 更新,更新全部字段 -->
|
||||
<update id="update" parameterType="com.engine.salary.entity.taxrate.TaxRateBase">
|
||||
UPDATE hrsa_tax_rate_base
|
||||
<set>
|
||||
create_time=#{createTime},
|
||||
creator=#{creator},
|
||||
delete_type=#{deleteType},
|
||||
description=#{description},
|
||||
name=#{name},
|
||||
system_type=#{systemType},
|
||||
tenant_key=#{tenantKey},
|
||||
update_time=#{updateTime},
|
||||
</set>
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</update>
|
||||
|
||||
|
||||
<!-- 更新不为NULL的字段 -->
|
||||
<update id="updateIgnoreNull" parameterType="com.engine.salary.entity.taxrate.TaxRateBase">
|
||||
UPDATE hrsa_tax_rate_base
|
||||
<set>
|
||||
<if test="createTime != null">
|
||||
create_time=#{createTime},
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
creator=#{creator},
|
||||
</if>
|
||||
<if test="deleteType != null">
|
||||
delete_type=#{deleteType},
|
||||
</if>
|
||||
<if test="description != null">
|
||||
description=#{description},
|
||||
</if>
|
||||
<if test="name != null">
|
||||
name=#{name},
|
||||
</if>
|
||||
<if test="systemType != null">
|
||||
system_type=#{systemType},
|
||||
</if>
|
||||
<if test="tenantKey != null">
|
||||
tenant_key=#{tenantKey},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time=#{updateTime},
|
||||
</if>
|
||||
</set>
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</update>
|
||||
|
||||
|
||||
<!-- 根据主键删除记录 -->
|
||||
<delete id="delete" parameterType="com.engine.salary.entity.taxrate.TaxRateBase">
|
||||
UPDATE hrsa_tax_rate_base
|
||||
SET delete_type=1
|
||||
WHERE id = #{id}
|
||||
AND delete_type = 0
|
||||
</delete>
|
||||
|
||||
|
||||
<select id="selectByIds" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="baseColumns"/>
|
||||
FROM hrsa_tax_rate_base
|
||||
WHERE delete_type = 0
|
||||
<include refid="paramSql"/>
|
||||
ORDER BY id DESC
|
||||
</select>
|
||||
|
||||
<select id="listBySome" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="baseColumns"/>
|
||||
FROM hrsa_tax_rate_base t
|
||||
WHERE delete_type = 0
|
||||
<include refid="paramSql"/>
|
||||
ORDER BY id DESC
|
||||
</select>
|
||||
|
||||
<update id="deleteByIds">
|
||||
UPDATE hrsa_tax_rate_base
|
||||
SET delete_type = 1
|
||||
WHERE delete_type = 0
|
||||
AND id IN
|
||||
<foreach collection="ids" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,76 @@
|
|||
package com.engine.salary.mapper;
|
||||
|
||||
import com.engine.salary.entity.taxrate.TaxRateDetail;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface TaxRateDetailMapper {
|
||||
|
||||
/**
|
||||
* 查询所有记录
|
||||
*
|
||||
* @return 返回集合,没有返回空List
|
||||
*/
|
||||
List<TaxRateDetail> listAll();
|
||||
|
||||
|
||||
/**
|
||||
* 根据主键查询
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 返回记录,没有返回null
|
||||
*/
|
||||
TaxRateDetail getById(Long id);
|
||||
|
||||
/**
|
||||
* 新增,插入所有字段
|
||||
*
|
||||
* @param taxRateDetail 新增的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int insert(TaxRateDetail taxRateDetail);
|
||||
|
||||
/**
|
||||
* 新增,忽略null字段
|
||||
*
|
||||
* @param taxRateDetail 新增的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int insertIgnoreNull(TaxRateDetail taxRateDetail);
|
||||
|
||||
/**
|
||||
* 修改,修改所有字段
|
||||
*
|
||||
* @param taxRateDetail 修改的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int update(TaxRateDetail taxRateDetail);
|
||||
|
||||
/**
|
||||
* 修改,忽略null字段
|
||||
*
|
||||
* @param taxRateDetail 修改的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int updateIgnoreNull(TaxRateDetail taxRateDetail);
|
||||
|
||||
/**
|
||||
* 删除记录
|
||||
*
|
||||
* @param taxRateDetail 待删除的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int delete(TaxRateDetail taxRateDetail);
|
||||
|
||||
|
||||
void deleteByBatchIds(@Param("baseIds") Collection<Long> baseIds);
|
||||
|
||||
List<TaxRateDetail> listByBaseId(Long baseId);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,316 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.engine.salary.mapper.TaxRateDetailMapper">
|
||||
<resultMap id="BaseResultMap" type="com.engine.salary.entity.taxrate.TaxRateDetail">
|
||||
<result column="base_id" property="baseId"/>
|
||||
<result column="create_time" property="createTime"/>
|
||||
<result column="creator" property="creator"/>
|
||||
<result column="delete_type" property="deleteType"/>
|
||||
<result column="duty_free_rate" property="dutyFreeRate"/>
|
||||
<result column="duty_free_value" property="dutyFreeValue"/>
|
||||
<result column="id" property="id"/>
|
||||
<result column="income_lower_limit" property="incomeLowerLimit"/>
|
||||
<result column="income_upper_limit" property="incomeUpperLimit"/>
|
||||
<result column="index_num" property="indexNum"/>
|
||||
<result column="tax_deduction" property="taxDeduction"/>
|
||||
<result column="tax_rate" property="taxRate"/>
|
||||
<result column="taxable_income_ll" property="taxableIncomeLl"/>
|
||||
<result column="taxable_income_ul" property="taxableIncomeUl"/>
|
||||
<result column="tenant_key" property="tenantKey"/>
|
||||
<result column="update_time" property="updateTime"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 表字段 -->
|
||||
<sql id="baseColumns">
|
||||
t.base_id
|
||||
, t.create_time
|
||||
, t.creator
|
||||
, t.delete_type
|
||||
, t.duty_free_rate
|
||||
, t.duty_free_value
|
||||
, t.id
|
||||
, t.income_lower_limit
|
||||
, t.income_upper_limit
|
||||
, t.index_num
|
||||
, t.tax_deduction
|
||||
, t.tax_rate
|
||||
, t.taxable_income_ll
|
||||
, t.taxable_income_ul
|
||||
, t.tenant_key
|
||||
, t.update_time
|
||||
</sql>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="listAll" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="baseColumns"/>
|
||||
FROM hrsa_tax_rate_detail t
|
||||
WHERE delete_type = 0
|
||||
</select>
|
||||
|
||||
<!-- 根据主键获取单条记录 -->
|
||||
<select id="getById" resultMap="BaseResultMap" parameterType="Long">
|
||||
SELECT
|
||||
<include refid="baseColumns"/>
|
||||
FROM hrsa_tax_rate_detail t
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</select>
|
||||
|
||||
<!-- 插入全部字段 -->
|
||||
<insert id="insert" parameterType="com.engine.salary.entity.taxrate.TaxRateDetail"
|
||||
keyProperty="id" keyColumn="id" useGeneratedKeys="true"
|
||||
>
|
||||
INSERT INTO hrsa_tax_rate_detail
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
base_id,
|
||||
create_time,
|
||||
creator,
|
||||
delete_type,
|
||||
duty_free_rate,
|
||||
duty_free_value,
|
||||
id,
|
||||
income_lower_limit,
|
||||
income_upper_limit,
|
||||
index_num,
|
||||
tax_deduction,
|
||||
tax_rate,
|
||||
taxable_income_ll,
|
||||
taxable_income_ul,
|
||||
tenant_key,
|
||||
update_time,
|
||||
</trim>
|
||||
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
||||
#{baseId},
|
||||
#{createTime},
|
||||
#{creator},
|
||||
#{deleteType},
|
||||
#{dutyFreeRate},
|
||||
#{dutyFreeValue},
|
||||
#{id},
|
||||
#{incomeLowerLimit},
|
||||
#{incomeUpperLimit},
|
||||
#{indexNum},
|
||||
#{taxDeduction},
|
||||
#{taxRate},
|
||||
#{taxableIncomeLl},
|
||||
#{taxableIncomeUl},
|
||||
#{tenantKey},
|
||||
#{updateTime},
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<!-- 插入不为NULL的字段 -->
|
||||
<insert id="insertIgnoreNull" parameterType="com.engine.salary.entity.taxrate.TaxRateDetail"
|
||||
keyProperty="id" keyColumn="id" useGeneratedKeys="true"
|
||||
>
|
||||
INSERT INTO hrsa_tax_rate_detail
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
|
||||
<if test="baseId != null">
|
||||
base_id,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
creator,
|
||||
</if>
|
||||
<if test="deleteType != null">
|
||||
delete_type,
|
||||
</if>
|
||||
<if test="dutyFreeRate != null">
|
||||
duty_free_rate,
|
||||
</if>
|
||||
<if test="dutyFreeValue != null">
|
||||
duty_free_value,
|
||||
</if>
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="incomeLowerLimit != null">
|
||||
income_lower_limit,
|
||||
</if>
|
||||
<if test="incomeUpperLimit != null">
|
||||
income_upper_limit,
|
||||
</if>
|
||||
<if test="indexNum != null">
|
||||
index_num,
|
||||
</if>
|
||||
<if test="taxDeduction != null">
|
||||
tax_deduction,
|
||||
</if>
|
||||
<if test="taxRate != null">
|
||||
tax_rate,
|
||||
</if>
|
||||
<if test="taxableIncomeLl != null">
|
||||
taxable_income_ll,
|
||||
</if>
|
||||
<if test="taxableIncomeUl != null">
|
||||
taxable_income_ul,
|
||||
</if>
|
||||
<if test="tenantKey != null">
|
||||
tenant_key,
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
||||
<if test="baseId != null">
|
||||
#{baseId},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
#{createTime},
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
#{creator},
|
||||
</if>
|
||||
<if test="deleteType != null">
|
||||
#{deleteType},
|
||||
</if>
|
||||
<if test="dutyFreeRate != null">
|
||||
#{dutyFreeRate},
|
||||
</if>
|
||||
<if test="dutyFreeValue != null">
|
||||
#{dutyFreeValue},
|
||||
</if>
|
||||
<if test="id != null">
|
||||
#{id},
|
||||
</if>
|
||||
<if test="incomeLowerLimit != null">
|
||||
#{incomeLowerLimit},
|
||||
</if>
|
||||
<if test="incomeUpperLimit != null">
|
||||
#{incomeUpperLimit},
|
||||
</if>
|
||||
<if test="indexNum != null">
|
||||
#{indexNum},
|
||||
</if>
|
||||
<if test="taxDeduction != null">
|
||||
#{taxDeduction},
|
||||
</if>
|
||||
<if test="taxRate != null">
|
||||
#{taxRate},
|
||||
</if>
|
||||
<if test="taxableIncomeLl != null">
|
||||
#{taxableIncomeLl},
|
||||
</if>
|
||||
<if test="taxableIncomeUl != null">
|
||||
#{taxableIncomeUl},
|
||||
</if>
|
||||
<if test="tenantKey != null">
|
||||
#{tenantKey},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
#{updateTime},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<!-- 更新,更新全部字段 -->
|
||||
<update id="update" parameterType="com.engine.salary.entity.taxrate.TaxRateDetail">
|
||||
UPDATE hrsa_tax_rate_detail
|
||||
<set>
|
||||
base_id=#{baseId},
|
||||
create_time=#{createTime},
|
||||
creator=#{creator},
|
||||
delete_type=#{deleteType},
|
||||
duty_free_rate=#{dutyFreeRate},
|
||||
duty_free_value=#{dutyFreeValue},
|
||||
income_lower_limit=#{incomeLowerLimit},
|
||||
income_upper_limit=#{incomeUpperLimit},
|
||||
index_num=#{indexNum},
|
||||
tax_deduction=#{taxDeduction},
|
||||
tax_rate=#{taxRate},
|
||||
taxable_income_ll=#{taxableIncomeLl},
|
||||
taxable_income_ul=#{taxableIncomeUl},
|
||||
tenant_key=#{tenantKey},
|
||||
update_time=#{updateTime},
|
||||
</set>
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</update>
|
||||
|
||||
|
||||
<!-- 更新不为NULL的字段 -->
|
||||
<update id="updateIgnoreNull" parameterType="com.engine.salary.entity.taxrate.TaxRateDetail">
|
||||
UPDATE hrsa_tax_rate_detail
|
||||
<set>
|
||||
<if test="baseId != null">
|
||||
base_id=#{baseId},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time=#{createTime},
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
creator=#{creator},
|
||||
</if>
|
||||
<if test="deleteType != null">
|
||||
delete_type=#{deleteType},
|
||||
</if>
|
||||
<if test="dutyFreeRate != null">
|
||||
duty_free_rate=#{dutyFreeRate},
|
||||
</if>
|
||||
<if test="dutyFreeValue != null">
|
||||
duty_free_value=#{dutyFreeValue},
|
||||
</if>
|
||||
<if test="incomeLowerLimit != null">
|
||||
income_lower_limit=#{incomeLowerLimit},
|
||||
</if>
|
||||
<if test="incomeUpperLimit != null">
|
||||
income_upper_limit=#{incomeUpperLimit},
|
||||
</if>
|
||||
<if test="indexNum != null">
|
||||
index_num=#{indexNum},
|
||||
</if>
|
||||
<if test="taxDeduction != null">
|
||||
tax_deduction=#{taxDeduction},
|
||||
</if>
|
||||
<if test="taxRate != null">
|
||||
tax_rate=#{taxRate},
|
||||
</if>
|
||||
<if test="taxableIncomeLl != null">
|
||||
taxable_income_ll=#{taxableIncomeLl},
|
||||
</if>
|
||||
<if test="taxableIncomeUl != null">
|
||||
taxable_income_ul=#{taxableIncomeUl},
|
||||
</if>
|
||||
<if test="tenantKey != null">
|
||||
tenant_key=#{tenantKey},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time=#{updateTime},
|
||||
</if>
|
||||
</set>
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</update>
|
||||
|
||||
|
||||
<!-- 根据主键删除记录 -->
|
||||
<delete id="delete" parameterType="com.engine.salary.entity.taxrate.TaxRateDetail">
|
||||
UPDATE hrsa_tax_rate_detail
|
||||
SET delete_type=1
|
||||
WHERE id = #{id}
|
||||
AND delete_type = 0
|
||||
</delete>
|
||||
|
||||
<update id="deleteByBatchIds">
|
||||
UPDATE hrsa_tax_rate_detail
|
||||
SET delete_type = 1
|
||||
WHERE delete_type = 0
|
||||
AND base_id IN
|
||||
<foreach collection="baseIds" open="(" item="baseId" separator="," close=")">
|
||||
#{baseId}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<select id="listByBaseId" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="baseColumns"/>
|
||||
FROM hrsa_tax_rate_detail t
|
||||
WHERE delete_type = 0 AND t.base_id = #{baseId}
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
package com.engine.salary.service;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public interface TaxRateBaseService {
|
||||
|
||||
|
||||
/**
|
||||
* 分页列表
|
||||
*/
|
||||
Map<String, Object> listPage(Map<String, Object> params);
|
||||
|
||||
Map<String, Object> delete(Map<String, Object> params);
|
||||
|
||||
Map<String, Object> save(Map<String, Object> params);
|
||||
}
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
package com.engine.salary.service.impl;
|
||||
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.cmd.TaxRate.TaxRateDeleteCmd;
|
||||
import com.engine.salary.cmd.TaxRate.TaxRateListCmd;
|
||||
import com.engine.salary.service.TaxRateBaseService;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
public class TaxRateBaseServiceImpl extends Service implements TaxRateBaseService {
|
||||
|
||||
@Override
|
||||
public Map<String, Object> listPage(Map<String, Object> params) {
|
||||
return commandExecutor.execute(new TaxRateListCmd(params,user));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public Map<String, Object> save(Map<String, Object> params) {
|
||||
return commandExecutor.execute(new TaxRateListCmd(params,user));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public Map<String, Object> delete(Map<String, Object> params) {
|
||||
return commandExecutor.execute(new TaxRateDeleteCmd(params,user));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
package com.engine.salary.util;
|
||||
|
||||
import java.lang.reflect.Array;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class DataUtil {
|
||||
|
||||
public static <T> List<T> castList(Object obj, Class<T> clazz) {
|
||||
|
||||
List<T> result = new ArrayList<T>();
|
||||
if (obj.getClass().isArray()) {
|
||||
int len = Array.getLength(obj);
|
||||
for (int i = 0; i < len; i++) {
|
||||
Object o = Array.get(obj, i);
|
||||
result.add(clazz.cast(o));
|
||||
}
|
||||
} else if (obj instanceof List<?>) {
|
||||
for (Object o : (List<?>) obj) {
|
||||
result.add(clazz.cast(o));
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,163 @@
|
|||
package com.engine.salary.util;
|
||||
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description: 空指针判断工具类
|
||||
* @Author: zhangheng
|
||||
* @CreateDate: 2022/1/17 11:36
|
||||
* @Version: v1.0
|
||||
*/
|
||||
public abstract class SalaryAssert {
|
||||
|
||||
/**
|
||||
* 判断入参不为null
|
||||
*
|
||||
* @param object 待检查参数
|
||||
* @param message 检查失败返回的异常信息
|
||||
*/
|
||||
public static void notNull(Object object, String message) {
|
||||
if (object == null) {
|
||||
throw new SalaryRunTimeException(message);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断多个入参不为null
|
||||
*
|
||||
* @param message 检查失败返回的异常信息
|
||||
* @param objects 待检查参数
|
||||
*/
|
||||
public static void notNull(String message, Object... objects) {
|
||||
for (Object obj : objects) {
|
||||
if (obj == null) {
|
||||
throw new SalaryRunTimeException(message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断入参为null
|
||||
*
|
||||
* @param object 待检查参数
|
||||
* @param message 检查失败返回的异常信息
|
||||
*/
|
||||
public static void isNull(Object object, String message) {
|
||||
if (object != null) {
|
||||
throw new SalaryRunTimeException(message);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断集合是否为空
|
||||
*
|
||||
* @param collection 待检查参数
|
||||
* @param message 检查失败返回的异常信息
|
||||
*/
|
||||
public static void isEmpty(Collection<?> collection, String message) {
|
||||
if (!CollectionUtils.isEmpty(collection)) {
|
||||
throw new SalaryRunTimeException(message);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断集合不为空
|
||||
*
|
||||
* @param collection 待检查参数
|
||||
* @param message 检查失败返回的异常信息
|
||||
*/
|
||||
public static void notEmpty(Collection<?> collection, String message) {
|
||||
if (CollectionUtils.isEmpty(collection)) {
|
||||
throw new SalaryRunTimeException(message);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断数组是否为空
|
||||
*
|
||||
* @param arr 待检查参数
|
||||
* @param message 检查失败返回的异常信息
|
||||
*/
|
||||
public static void notEmpty(Object[] arr, String message) {
|
||||
if (ObjectUtils.isEmpty(arr)) {
|
||||
throw new SalaryRunTimeException(message);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断map是否为空
|
||||
*
|
||||
* @param map 待检查参数
|
||||
* @param message 检查失败返回的异常信息
|
||||
*/
|
||||
public static void notEmpty(Map<?, ?> map, String message) {
|
||||
if (CollectionUtils.isEmpty(map)) {
|
||||
throw new SalaryRunTimeException(message);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断数组元素是否为空
|
||||
*
|
||||
* @param arr 待检查参数
|
||||
* @param message 检查失败返回的异常信息
|
||||
*/
|
||||
public static void notNullElement(Object[] arr, String message) {
|
||||
if (arr != null) {
|
||||
for (Object obj : arr) {
|
||||
if (obj == null) {
|
||||
throw new SalaryRunTimeException(message);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断boolean
|
||||
*
|
||||
* @param expression 待检查参数
|
||||
* @param message 检查失败返回的异常信息
|
||||
*/
|
||||
public static void isTrue(boolean expression, String message) {
|
||||
if (!expression) {
|
||||
throw new SalaryRunTimeException(message);
|
||||
}
|
||||
}
|
||||
|
||||
public static void isFalse(boolean expression, String message) {
|
||||
if (expression) {
|
||||
throw new SalaryRunTimeException(message);
|
||||
}
|
||||
}
|
||||
|
||||
public static void isBlank(CharSequence cs, String message) {
|
||||
int strLen;
|
||||
if (cs != null && (strLen = cs.length()) != 0) {
|
||||
for (int i = 0; i < strLen; ++i) {
|
||||
if (!Character.isWhitespace(cs.charAt(i))) {
|
||||
throw new SalaryRunTimeException(message);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void notBlank(CharSequence cs, String message) {
|
||||
int strLen;
|
||||
if (cs != null && (strLen = cs.length()) != 0) {
|
||||
for (int i = 0; i < strLen; ++i) {
|
||||
if (Character.isWhitespace(cs.charAt(i))) {
|
||||
throw new SalaryRunTimeException(message);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (cs == null || cs.length() == 0) {
|
||||
throw new SalaryRunTimeException(message);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,208 @@
|
|||
package com.engine.salary.util;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.math.NumberUtils;
|
||||
import org.apache.commons.lang3.time.FastDateFormat;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.*;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.time.temporal.TemporalAdjusters;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* @description: 时间工具类
|
||||
* @author: xiajun
|
||||
* @modified By: xiajun
|
||||
* @date: Created in 10/19/21 4:23 PM
|
||||
* @version:v1.0
|
||||
*/
|
||||
@Slf4j
|
||||
public class SalaryDateUtil {
|
||||
|
||||
public static final ZoneId CTT = ZoneId.of(ZoneId.SHORT_IDS.get("CTT"));
|
||||
public static final ZoneOffset SHANGHAI_ZONE_OFF_SET = ZoneOffset.ofHours(8);
|
||||
|
||||
public static final FastDateFormat DATE_FORMAT = FastDateFormat.getInstance("yyyy-MM-dd");
|
||||
public static final FastDateFormat DATETIME_FORMAT = FastDateFormat.getInstance("yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
public static final DateTimeFormatter MONTH_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM");
|
||||
public static final DateTimeFormatter DATE_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||
public static final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||
/**
|
||||
* yyyy-MM
|
||||
**/
|
||||
private static final String MONTH_REGEX = "^([1-9]\\d{3})-(([0]{0,1}[1-9])|([1][0-2]))$";
|
||||
/**
|
||||
* yyyy-MM-dd
|
||||
**/
|
||||
private static final String DAY_REGEX = "^[1-9]\\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$";
|
||||
/**
|
||||
* 含斜杠日期格式
|
||||
*/
|
||||
private static final String DAY_BAR_REGEX = "^[1-9]\\d{3}/([1-9]|1[0-2])/([1-9]|[1-2][0-9]|3[0-1])$";
|
||||
|
||||
public static Long localDate2EpochMilli(LocalDate localDate) {
|
||||
if (localDate == null) {
|
||||
return NumberUtils.LONG_ZERO;
|
||||
}
|
||||
return localDate.atStartOfDay(ZoneId.systemDefault()).toInstant().toEpochMilli();
|
||||
}
|
||||
|
||||
public static Long localDateTime2EpochMilli(LocalDateTime localDateTime) {
|
||||
if (localDateTime == null) {
|
||||
return NumberUtils.LONG_ZERO;
|
||||
}
|
||||
return localDateTime.atZone(ZoneId.systemDefault()).toInstant().toEpochMilli();
|
||||
}
|
||||
|
||||
public static String getFormatYearMonth(LocalDate localDate) {
|
||||
if (localDate == null) {
|
||||
return StringUtils.EMPTY;
|
||||
}
|
||||
try {
|
||||
return localDate.format(MONTH_FORMATTER);
|
||||
} catch (Exception e) {
|
||||
log.warn("格式化月份错误", e);
|
||||
return StringUtils.EMPTY;
|
||||
}
|
||||
}
|
||||
|
||||
public static String getFormatLocalDate(LocalDateTime localDateTime) {
|
||||
if (localDateTime == null) {
|
||||
return StringUtils.EMPTY;
|
||||
}
|
||||
try {
|
||||
return localDateTime.format(DATE_FORMATTER);
|
||||
} catch (Exception e) {
|
||||
log.warn("格式化日期错误", e);
|
||||
return StringUtils.EMPTY;
|
||||
}
|
||||
}
|
||||
|
||||
public static String getFormatLocalDateTime(LocalDateTime localDateTime) {
|
||||
if (localDateTime == null) {
|
||||
return StringUtils.EMPTY;
|
||||
}
|
||||
try {
|
||||
return localDateTime.format(DATE_TIME_FORMATTER);
|
||||
} catch (Exception e) {
|
||||
log.warn("格式化日期错误", e);
|
||||
return StringUtils.EMPTY;
|
||||
}
|
||||
}
|
||||
|
||||
public static LocalDateTime dateToLocalDateTime(Date date) {
|
||||
Instant instant = date.toInstant();
|
||||
ZoneId zone = ZoneId.systemDefault();
|
||||
return LocalDateTime.ofInstant(instant, zone);
|
||||
}
|
||||
|
||||
public static Date localDateToDate(LocalDate localDate) {
|
||||
if (null == localDate) {
|
||||
return null;
|
||||
}
|
||||
ZonedDateTime zonedDateTime = localDate.atStartOfDay(ZoneId.systemDefault());
|
||||
return Date.from(zonedDateTime.toInstant());
|
||||
}
|
||||
|
||||
public static String getFormatLocalDate(Date date) {
|
||||
if (date == null) {
|
||||
return StringUtils.EMPTY;
|
||||
}
|
||||
LocalDateTime localDateTime = dateToLocalDateTime(date);
|
||||
return getFormatLocalDate(localDateTime);
|
||||
}
|
||||
|
||||
public static YearMonth localDate2YearMonth(LocalDate localDate) {
|
||||
if (localDate == null) {
|
||||
return null;
|
||||
}
|
||||
return YearMonth.of(localDate.getYear(), localDate.getMonthValue());
|
||||
}
|
||||
|
||||
// public static LocalDateRange localDate2Range(LocalDate localDate) {
|
||||
// if (localDate == null) {
|
||||
// return null;
|
||||
// }
|
||||
// return LocalDateRange.builder()
|
||||
// .fromDate(localDate.with(TemporalAdjusters.firstDayOfMonth()))
|
||||
// .endDate(localDate.with(TemporalAdjusters.lastDayOfMonth()))
|
||||
// .build();
|
||||
// }
|
||||
//
|
||||
// public static LocalDateRange localDate2YearRange(LocalDate localDate) {
|
||||
// if (localDate == null) {
|
||||
// return null;
|
||||
// }
|
||||
// return LocalDateRange.builder()
|
||||
// .fromDate(localDate.with(TemporalAdjusters.firstDayOfYear()))
|
||||
// .endDate(localDate.with(TemporalAdjusters.lastDayOfYear()))
|
||||
// .build();
|
||||
// }
|
||||
|
||||
public static String getMonthBegin(String specifiedDay) {
|
||||
int year;
|
||||
int month;
|
||||
Pattern pattern = Pattern.compile("\\d+-\\d+");
|
||||
Matcher matcher = pattern.matcher(specifiedDay);
|
||||
if (StringUtils.isEmpty(specifiedDay) || !matcher.matches()) {
|
||||
return null;
|
||||
} else {
|
||||
year = Integer.parseInt(specifiedDay.split("-")[0]);
|
||||
month = Integer.parseInt(specifiedDay.split("-")[1]);
|
||||
}
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.set(Calendar.YEAR, year);
|
||||
calendar.set(Calendar.MONTH, month - 1);
|
||||
calendar.set(Calendar.DAY_OF_MONTH, 1);
|
||||
calendar.set(Calendar.HOUR_OF_DAY, 0);
|
||||
calendar.set(Calendar.MINUTE, 0);
|
||||
calendar.set(Calendar.SECOND, 0);
|
||||
calendar.set(Calendar.MILLISECOND, 0);
|
||||
Date startDate = calendar.getTime();
|
||||
return sdf.format(startDate);
|
||||
}
|
||||
|
||||
public static String getYearMonth(int yearNum, int monthNum) {
|
||||
LocalDateTime dateTime = LocalDateTime.now();
|
||||
int year = dateTime.getYear() + yearNum;
|
||||
int month = dateTime.getMonthValue() + monthNum;
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.set(Calendar.YEAR, year);
|
||||
calendar.set(Calendar.MONTH, month - 1);
|
||||
calendar.set(Calendar.DAY_OF_MONTH, 1);
|
||||
calendar.set(Calendar.HOUR_OF_DAY, 0);
|
||||
calendar.set(Calendar.MINUTE, 0);
|
||||
calendar.set(Calendar.SECOND, 0);
|
||||
calendar.set(Calendar.MILLISECOND, 0);
|
||||
Date startDate = calendar.getTime();
|
||||
return sdf.format(startDate);
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查年月格式
|
||||
*
|
||||
* @param yearMonth
|
||||
* @return
|
||||
*/
|
||||
public static boolean checkYearMonth(String yearMonth) {
|
||||
return Pattern.matches(MONTH_REGEX, yearMonth);
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查日期格式
|
||||
*
|
||||
* @param day
|
||||
* @return
|
||||
*/
|
||||
public static boolean checkDay(String day) {
|
||||
return Pattern.matches(DAY_REGEX, day) || Pattern.matches(DAY_BAR_REGEX, day);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,175 @@
|
|||
package com.engine.salary.util;
|
||||
|
||||
import com.google.common.collect.Maps;
|
||||
import com.google.common.collect.Sets;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.collections4.MapUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collector;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @description: 实体类相关
|
||||
* @author: xiajun
|
||||
* @modified By: xiajun
|
||||
* @date: Created in 10/28/21 5:36 PM
|
||||
* @version:v1.0
|
||||
*/
|
||||
public class SalaryEntityUtil {
|
||||
|
||||
private static final DecimalFormat decimalFormat = new DecimalFormat("#,##0.00");
|
||||
|
||||
/**
|
||||
* 千分位格式化
|
||||
*
|
||||
* @param originMap 原始map
|
||||
* @param targetMap 目标map
|
||||
*/
|
||||
public static void thousandthConvert(Map<String, Object> originMap, Map<String, Object> targetMap) {
|
||||
|
||||
if (MapUtils.isNotEmpty(originMap)) {
|
||||
originMap.forEach((k, v) -> {
|
||||
if (StringUtils.isNotBlank(String.valueOf(v))) {
|
||||
targetMap.put(k, decimalFormat.format(Double.valueOf(String.valueOf(v))));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 千分位格式化
|
||||
*
|
||||
* @param originString 原始字符串
|
||||
* @return 格式化后的字符串
|
||||
*/
|
||||
public static String thousandthConvert(String originString) {
|
||||
if (StringUtils.isNotBlank(originString)) {
|
||||
return decimalFormat.format(Double.valueOf(originString));
|
||||
}
|
||||
return "0.00";
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断对象或对象数组中每一个对象是否为空: 对象为null,字符序列长度为0,集合类、Map为empty
|
||||
*
|
||||
* @param obj
|
||||
* @return
|
||||
*/
|
||||
public static boolean isNullOrEmpty(Object obj) {
|
||||
if (obj == null) {
|
||||
return true;
|
||||
}
|
||||
if (obj instanceof CharSequence) {
|
||||
return ((CharSequence) obj).length() == 0;
|
||||
}
|
||||
if (obj instanceof Collection) {
|
||||
return ((Collection) obj).isEmpty();
|
||||
}
|
||||
if (obj instanceof Map) {
|
||||
return ((Map) obj).isEmpty();
|
||||
}
|
||||
if (obj instanceof Object[]) {
|
||||
Object[] object = (Object[]) obj;
|
||||
if (object.length == 0) {
|
||||
return true;
|
||||
}
|
||||
boolean empty = true;
|
||||
for (int i = 0; i < object.length; i++) {
|
||||
if (!isNullOrEmpty(object[i])) {
|
||||
empty = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return empty;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean isNotNullOrEmpty(Object obj) {
|
||||
return !isNullOrEmpty(obj);
|
||||
}
|
||||
|
||||
public static <R, T, A> A properties(Collection<T> objs, Function<T, R> function, Collector<R, ?, A> collectors) {
|
||||
return objs.stream().map(function).collect(collectors);
|
||||
}
|
||||
|
||||
public static <R, T> Set<R> properties(Collection<T> objs, Function<T, R> function) {
|
||||
if (CollectionUtils.isEmpty(objs)) {
|
||||
return Sets.newHashSet();
|
||||
}
|
||||
return properties(objs, function, Collectors.toSet());
|
||||
}
|
||||
|
||||
public static <R, T> Map<R, T> convert2Map(Collection<T> objs, Function<T, R> function) {
|
||||
if (CollectionUtils.isEmpty(objs)) {
|
||||
return Maps.newHashMap();
|
||||
}
|
||||
return objs.stream().collect(Collectors.toMap(function, Function.identity(), (a, b) -> a));
|
||||
}
|
||||
|
||||
public static <T, K, V> Map<K, V> convert2Map(Collection<T> objs, Function<T, K> keyMapper, Function<T, V> valueMapper) {
|
||||
if (CollectionUtils.isEmpty(objs)) {
|
||||
return Maps.newHashMap();
|
||||
}
|
||||
return objs.stream()
|
||||
.filter(e -> valueMapper.apply(e) != null && keyMapper.apply(e) != null)
|
||||
.collect(Collectors.toMap(keyMapper, valueMapper, (a, b) -> a));
|
||||
}
|
||||
|
||||
public static <R, T> Map<R, List<T>> group2Map(Collection<T> objs, Function<T, R> function) {
|
||||
if (CollectionUtils.isEmpty(objs)) {
|
||||
return Maps.newHashMap();
|
||||
}
|
||||
return objs.stream().collect(Collectors.groupingBy(function));
|
||||
}
|
||||
|
||||
public static <T, K, V> Map<K, Set<V>> group2Map(Collection<T> objs, Function<T, K> keyMapper, Function<T, V> valueMapper) {
|
||||
if (CollectionUtils.isEmpty(objs)) {
|
||||
return Maps.newHashMap();
|
||||
}
|
||||
return objs.stream()
|
||||
.filter(e -> keyMapper.apply(e) != null && valueMapper.apply(e) != null)
|
||||
.collect(Collectors.groupingBy(keyMapper,
|
||||
Collectors.collectingAndThen(Collectors.toList(), e -> e.stream().map(valueMapper).collect(Collectors.toSet()))));
|
||||
}
|
||||
|
||||
public static <T, K, V> Map<K, List<V>> group2ListMap(Collection<T> objs, Function<T, K> keyMapper, Function<T, V> valueMapper) {
|
||||
if (CollectionUtils.isEmpty(objs)) {
|
||||
return Maps.newHashMap();
|
||||
}
|
||||
return objs.stream()
|
||||
.filter(e -> keyMapper.apply(e) != null && valueMapper.apply(e) != null)
|
||||
.collect(Collectors.groupingBy(keyMapper,
|
||||
Collectors.collectingAndThen(Collectors.toList(), e -> e.stream().map(valueMapper).collect(Collectors.toList()))));
|
||||
}
|
||||
|
||||
public static <T> BigDecimal reduce(Collection<T> objs, Function<T, BigDecimal> function) {
|
||||
if (CollectionUtils.isEmpty(objs)) {
|
||||
return BigDecimal.ZERO;
|
||||
}
|
||||
return objs.stream()
|
||||
.filter(e -> function.apply(e) != null)
|
||||
.map(function)
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
}
|
||||
|
||||
public static BigDecimal empty2Zero(String value) {
|
||||
if (StringUtils.isEmpty(value)) {
|
||||
return BigDecimal.ZERO;
|
||||
}
|
||||
try {
|
||||
return new BigDecimal(value);
|
||||
} catch (Exception e) {
|
||||
return BigDecimal.ZERO;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
package com.engine.salary.util;
|
||||
|
||||
import com.engine.salary.enums.BaseEnum;
|
||||
import com.engine.salary.enums.sicategory.PaymentScopeEnum;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
* @Author: zhangheng
|
||||
* @CreateDate: 2021/11/19 16:39
|
||||
* @Version: v1.0
|
||||
*/
|
||||
public class SalaryEnumUtil {
|
||||
|
||||
/**
|
||||
* 根据枚举的value获取枚举对象
|
||||
*
|
||||
* @param value 枚举中的value
|
||||
* @param list
|
||||
* @param T
|
||||
* @param <T>
|
||||
* @return
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public static <T> T enumMatchByValue(Integer value, BaseEnum<Integer>[] list, Class<? extends BaseEnum<Integer>> T) {
|
||||
return (T) Arrays.stream(list).filter(item -> Objects.equals(item.getValue(), value)).findFirst().get();
|
||||
}
|
||||
|
||||
/**
|
||||
* 枚举数组转字符串
|
||||
*
|
||||
* @param list
|
||||
* @return
|
||||
*/
|
||||
public static String enumArrToString(BaseEnum<Integer>[] list) {
|
||||
List<String> collect = Arrays.stream(list).map(item -> String.valueOf(item.getValue())).collect(Collectors.toList());
|
||||
return StringUtils.join(collect, ",");
|
||||
}
|
||||
|
||||
public static PaymentScopeEnum[] stringToEnums(String values, String charSequence) {
|
||||
String[] arr = values.split(charSequence);
|
||||
PaymentScopeEnum[] enumConstants = PaymentScopeEnum.values();
|
||||
List<PaymentScopeEnum> collect = Arrays.stream(arr)
|
||||
.map(item -> Arrays.stream(enumConstants).filter(s -> Objects.equals(String.valueOf(s.getValue()), item)).findFirst().get()).collect(Collectors.toList());
|
||||
return collect.toArray(new PaymentScopeEnum[collect.size()]);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,51 @@
|
|||
package com.engine.salary.util;
|
||||
|
||||
import weaver.systeminfo.SystemEnv;
|
||||
|
||||
/**
|
||||
* @description: 多语言工具类
|
||||
* @author: xiajun
|
||||
* @modified By: xiajun
|
||||
* @date: Created in 10/19/21 4:18 PM
|
||||
* @version:v1.0
|
||||
*/
|
||||
public class SalaryI18nUtil {
|
||||
|
||||
// /**
|
||||
// * 获取多语言信息
|
||||
// *
|
||||
// * @param labelId 多语言对应的labelId
|
||||
// * @param defaultLabel 默认中文
|
||||
// * @return
|
||||
// */
|
||||
// public static String getI18nLabel(int labelId, String defaultLabel) {
|
||||
// return SystemEnv.getHtmlLabelName(labelId, defaultLabel);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 获取多语言信息
|
||||
// *
|
||||
// * @param tenantKey 租户key
|
||||
// * @param employeeId 人员id
|
||||
// * @param labelId 多语言对应的labelId
|
||||
// * @param defaultLabel 默认中文
|
||||
// * @return
|
||||
// */
|
||||
// public static String getI18nLabel(String tenantKey, Long employeeId, int labelId, String defaultLabel) {
|
||||
// int languageId = I18nLanguageUtil.getLangId(employeeId);
|
||||
// return SystemEnv.getHtmlLabelName(labelId, languageId, tenantKey, defaultLabel);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 获取多语言信息
|
||||
// *
|
||||
// * @param simpleEmployee 租户信息
|
||||
// * @param labelId 多语言对应的labelId
|
||||
// * @param defaultLabel 默认中文
|
||||
// * @return
|
||||
// */
|
||||
// public static String getI18nLabel(SimpleEmployee simpleEmployee, int labelId, String defaultLabel) {
|
||||
// int languageId = I18nLanguageUtil.getLangId(simpleEmployee.getEmployeeId());
|
||||
// return SystemEnv.getHtmlLabelName(labelId, languageId, simpleEmployee.getTenantKey(), defaultLabel);
|
||||
// }
|
||||
}
|
||||
|
|
@ -0,0 +1,73 @@
|
|||
package com.engine.salary.util;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 操作日志工具类
|
||||
* @Author: wangxiangzhong
|
||||
* @Date: 2021/11/1 11:31
|
||||
*/
|
||||
public class SalaryLoggerUtil {
|
||||
|
||||
// /**
|
||||
// * 记录单个对象新增操作日志
|
||||
// * @param loggerTemplate
|
||||
// * @param targetId
|
||||
// * @param targetName
|
||||
// * @param operateTypeName
|
||||
// * @param operatedesc
|
||||
// * @param newValues
|
||||
// */
|
||||
// public static void recordAddSingleLog(LoggerTemplate loggerTemplate, Long targetId, String targetName, String operateTypeName, String operatedesc, Object newValues) {
|
||||
// recoreSingleLog(loggerTemplate, targetId, targetName, OperateTypeEnum.ADD.getValue(), operateTypeName, operatedesc, null, newValues);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 记录单个对象修改操作日志
|
||||
// * @param loggerTemplate
|
||||
// * @param targetId
|
||||
// * @param targetName
|
||||
// * @param operateTypeName
|
||||
// * @param operatedesc
|
||||
// * @param oldValues
|
||||
// * @param newValues
|
||||
// */
|
||||
// public static void recordUpdateSingleLog(LoggerTemplate loggerTemplate, Long targetId, String targetName, String operateTypeName, String operatedesc, Object oldValues, Object newValues) {
|
||||
// recoreSingleLog(loggerTemplate, targetId, targetName, OperateTypeEnum.UPDATE.getValue(), operateTypeName, operatedesc, oldValues, newValues);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 记录单个对象删除操作日志
|
||||
// * @param loggerTemplate
|
||||
// * @param targetId
|
||||
// * @param targetName
|
||||
// * @param operateTypeName
|
||||
// * @param operatedesc
|
||||
// * @param oldValues
|
||||
// */
|
||||
// public static void recordDeleteSingleLog(LoggerTemplate loggerTemplate, Long targetId, String targetName, String operateTypeName, String operatedesc, Object oldValues) {
|
||||
// recoreSingleLog(loggerTemplate, targetId, targetName, OperateTypeEnum.DELETE.getValue(), operateTypeName, operatedesc, oldValues, null);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 记录单个对象日志
|
||||
// * @param loggerTemplate
|
||||
// * @param targetId
|
||||
// * @param targetName
|
||||
// * @param operateType
|
||||
// * @param operateTypeName
|
||||
// * @param operatedesc
|
||||
// * @param oldValues
|
||||
// * @param newValues
|
||||
// */
|
||||
// private static void recoreSingleLog(LoggerTemplate loggerTemplate, Long targetId, String targetName, String operateType, String operateTypeName, String operatedesc, Object oldValues, Object newValues) {
|
||||
// LoggerContext loggerContext = new LoggerContext();
|
||||
// loggerContext.setTargetId(String.valueOf(targetId));
|
||||
// loggerContext.setTargetName(targetName);
|
||||
// loggerContext.setOperateType(operateType);
|
||||
// loggerContext.setOperateTypeName(operateTypeName);
|
||||
// loggerContext.setOperatedesc(operatedesc);
|
||||
// loggerContext.setOldValues(oldValues);
|
||||
// loggerContext.setNewValues(newValues);
|
||||
// loggerTemplate.write(loggerContext);
|
||||
// }
|
||||
}
|
||||
|
|
@ -0,0 +1,80 @@
|
|||
package com.engine.salary.util;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
/**
|
||||
* @description: 此线程池类只适用于Runnalbe接口,不适用与Callable接口
|
||||
* 如有callable业务需要,请自行使用线程池创建,并确定要关闭
|
||||
* @author: xiajun
|
||||
* @modified By: xiajun
|
||||
* @date: Created in 1/25/22 4:23 PM
|
||||
* @version:v1.0
|
||||
*/
|
||||
public class SalaryThreadPoolUtil {
|
||||
|
||||
// /**
|
||||
// * 使用指定名称的线程池执行异步任务(线程池名称为module+function拼接生成)<br>
|
||||
// * 线程池最大并发线程数默认为10,核心线程数为0<br>
|
||||
// * 并发量、延时要求较低的功能,建议优先选用此方法,避免线程资源浪费<br>
|
||||
// *
|
||||
// * @param LocalRunnable 异步任务<br>
|
||||
// */
|
||||
// public static void execute(LocalRunnable LocalRunnable) {
|
||||
// execute(ModulePoolEnum.OTHER, "default", ModulePoolEnum.OTHER.getMaxThread(), LocalRunnable);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 使用指定名称的线程池执行异步任务(线程池名称为module+function拼接生成)<br>
|
||||
// * FixedThreadPool 线程池最大并发线程数为maximunPoolSize,核心线程数与maximunPoolSize相同<br>
|
||||
// * 并发量、延时要求高的功能,选用此方法,会保持一定的线程资源占用<br>
|
||||
// * 也可以使用重载方法,指定corePoolSize<maximunPoolSize<br>
|
||||
// *
|
||||
// * @param module 模块名称<br>
|
||||
// * @param function 功能描述<br>
|
||||
// * @param LocalRunnable 异步任务<br>
|
||||
// */
|
||||
// public static void fixedPoolExecute(ModulePoolEnum module, String function, LocalRunnable LocalRunnable) {
|
||||
// execute(module, function, module.getMaxThread(), LocalRunnable);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 使用指定名称的线程池执行异步任务(线程池名称为module+function拼接生成)<br>
|
||||
// * 线程池最大并发线程数为maximunPoolSize<br>
|
||||
// *
|
||||
// * @param module 模块名称<br>
|
||||
// * @param function 功能描述<br>
|
||||
// * @param maximunPoolSize 最大线程数<br>
|
||||
// * @param LocalRunnable 异步任务<br>
|
||||
// */
|
||||
// private static void execute(ModulePoolEnum module, String function, int maximunPoolSize, LocalRunnable LocalRunnable) {
|
||||
// execute(module, function, maximunPoolSize, maximunPoolSize, LocalRunnable);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 使用指定名称的线程池执行异步任务(线程池名称为module+function拼接生成)<br>
|
||||
// * 线程池最大并发线程数为maximunPoolSize<br>
|
||||
// *
|
||||
// * @param module 模块名称<br>
|
||||
// * @param function 功能描述<br>
|
||||
// * @param corePoolSize 核心线程数(即线程池空闲时,仍保留的线程数)<br>
|
||||
// * @param maximunPoolSize 最大线程数<br>
|
||||
// * @param LocalRunnable 异步任务<br>
|
||||
// */
|
||||
// private static void execute(ModulePoolEnum module, String function, int corePoolSize, int maximunPoolSize, LocalRunnable LocalRunnable) {
|
||||
// if (StringUtils.isEmpty(function)) {
|
||||
// function = "default";
|
||||
// }
|
||||
// LocalRunnable.setFunctiondesc(function);
|
||||
// LocalRunnable.setModule(module.name());
|
||||
// ThreadPoolFactory.getExecutor(module, corePoolSize, maximunPoolSize).execute(LocalRunnable);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 关闭指定的连接池,一般情况下不会使用,请勿随意调用<br>
|
||||
// *
|
||||
// * @param module 模块名称<br>
|
||||
// */
|
||||
// private void shutdown(ModulePoolEnum module) {
|
||||
// ThreadPoolFactory.shutdownExecutor(module);
|
||||
// }
|
||||
}
|
||||
|
|
@ -1,20 +1,103 @@
|
|||
package com.engine.salary.web;
|
||||
|
||||
import com.engine.common.util.ParamUtil;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.salary.service.TaxAgentService;
|
||||
import com.engine.salary.service.impl.TaxAgentServiceImpl;
|
||||
import com.engine.salary.service.TaxRateBaseService;
|
||||
import com.engine.salary.service.impl.TaxRateBaseServiceImpl;
|
||||
import com.engine.salary.util.ResponseResult;
|
||||
import weaver.general.BaseBean;
|
||||
import weaver.hrm.HrmUserVarify;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.ws.rs.GET;
|
||||
import javax.ws.rs.POST;
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.Produces;
|
||||
import javax.ws.rs.core.Context;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
|
||||
public class TaxRateController {
|
||||
|
||||
private BaseBean logger = new BaseBean();
|
||||
|
||||
// private TaxAgentService getService(User user) {
|
||||
// return (TaxRateService) ServiceUtil.getService(TaxAgentServiceImpl.class, user);
|
||||
private TaxRateBaseService getService(User user) {
|
||||
return (TaxRateBaseService) ServiceUtil.getService(TaxRateBaseServiceImpl.class, user);
|
||||
}
|
||||
|
||||
|
||||
//税率表列表
|
||||
@GET
|
||||
@Path("/list")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String list(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return ResponseResult.run(getService(user)::listPage, ParamUtil.request2Map(request));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新建税率表
|
||||
*/
|
||||
@POST
|
||||
@Path("/save")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String save(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return ResponseResult.run(getService(user)::save, ParamUtil.request2Map(request));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 删除税率表
|
||||
*/
|
||||
@POST
|
||||
@Path("/delete")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String deleteTaxRate(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return ResponseResult.run(getService(user)::delete, ParamUtil.request2Map(request));
|
||||
}
|
||||
|
||||
//
|
||||
// /**
|
||||
// * 新建税率表
|
||||
// *
|
||||
// * @param saveParam
|
||||
// * @return
|
||||
// */
|
||||
// @PostMapping("/save")
|
||||
// @ApiOperation("保存税率表")
|
||||
// @WeaPermission
|
||||
// public WeaResult<Object> saveTaxRate(@RequestBody @Validated TaxRateSaveParam saveParam) {
|
||||
// if (saveParam.getTaxRateBatch().getId() == null || saveParam.getTaxRateBatch().getId() <= 0) {
|
||||
// taxRateWrapper.save(saveParam, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey());
|
||||
// } else {
|
||||
// taxRateWrapper.update(saveParam, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey());
|
||||
// }
|
||||
// return WeaResult.success(null);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 编辑税率表
|
||||
// *
|
||||
// * @param saveParam
|
||||
// * @return
|
||||
// */
|
||||
// @PostMapping("/update")
|
||||
// @ApiOperation("编辑税率表")
|
||||
// @WeaPermission
|
||||
// public WeaResult<Object> updateTaxRate(@RequestBody @Validated TaxRateSaveParam saveParam) {
|
||||
// if (Objects.isNull(saveParam.getTaxRateBatch().getId())) {
|
||||
// return WeaResult.fail(SalaryI18nUtil.getI18nLabel(99703, "参数错误,ID不允许为空"));
|
||||
// }
|
||||
// taxRateWrapper.update(saveParam, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey());
|
||||
// return WeaResult.success(null);
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,21 @@
|
|||
package com.engine.salary.wrapper;
|
||||
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.service.TaxRateBaseService;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class TaxRateWrapper extends Service {
|
||||
|
||||
private TaxRateBaseService getService(User user) {
|
||||
return (TaxRateBaseService) ServiceUtil.getService(TaxRateWrapper.class, user);
|
||||
}
|
||||
|
||||
|
||||
public Map<String, Object> listPage(Map<String, Object> stringObjectMap) {
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue