!9 社保档案动态列接口

Merge pull request !9 from reset/archive
This commit is contained in:
reset 2022-03-18 10:04:59 +00:00 committed by Gitee
commit 620193471c
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
22 changed files with 714 additions and 34 deletions

View File

@ -0,0 +1,13 @@
package com.api.salary.web;
import javax.ws.rs.Path;
/**
* @Author weaver_cl
* @Description: TODO
* @Date 2022/3/17
* @Version V1.0
**/
@Path("/bs/salary")
public class DemoController extends com.engine.salary.demo.DemoController {
}

View File

@ -1,22 +1,23 @@
package com.engine.salary.biz;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.alibaba.nacos.client.naming.utils.CollectionUtils;
import com.api.browser.bean.SearchConditionGroup;
import com.api.browser.bean.SearchConditionItem;
import com.api.browser.bean.SearchConditionOption;
import com.cloudstore.eccom.pc.table.WeaTableColumn;
import com.engine.salary.constant.SalaryDefaultTenantConstant;
import com.engine.salary.demo.DemoPo;
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
import com.engine.salary.entity.siarchives.bo.InsuranceArchivesBO;
import com.engine.salary.entity.siarchives.dto.InsuranceArchivesBaseDTO;
import com.engine.salary.entity.siarchives.dto.InsuranceArchivesFundSchemeDTO;
import com.engine.salary.entity.siarchives.dto.InsuranceArchivesOtherSchemeDTO;
import com.engine.salary.entity.siarchives.dto.InsuranceArchivesSocialSchemeDTO;
import com.engine.salary.entity.siarchives.param.InsuranceArchivesFundSaveParam;
import com.engine.salary.entity.siarchives.param.InsuranceArchivesOtherSaveParam;
import com.engine.salary.entity.siarchives.param.InsuranceArchivesSaveParam;
import com.engine.salary.entity.siarchives.param.InsuranceArchivesSocialSaveParam;
import com.engine.salary.entity.siarchives.param.*;
import com.engine.salary.entity.siarchives.po.InsuranceArchivesEmployeePO;
import com.engine.salary.entity.siarchives.po.InsuranceArchivesFundSchemePO;
import com.engine.salary.entity.siarchives.po.InsuranceArchivesOtherSchemePO;
import com.engine.salary.entity.siarchives.po.InsuranceArchivesSocialSchemePO;
@ -24,19 +25,18 @@ import com.engine.salary.entity.sicategory.po.ICategoryPO;
import com.engine.salary.entity.sischeme.po.InsuranceSchemeDetailPO;
import com.engine.salary.entity.sischeme.po.InsuranceSchemePO;
import com.engine.salary.entity.taxrate.TaxAgent;
import com.engine.salary.enums.sicategory.DeleteTypeEnum;
import com.engine.salary.enums.sicategory.IsPaymentEnum;
import com.engine.salary.enums.sicategory.UndertakerEnum;
import com.engine.salary.enums.sicategory.WelfareTypeEnum;
import com.engine.salary.enums.sicategory.*;
import com.engine.salary.exception.SalaryRunTimeException;
import com.engine.salary.mapper.TaxAgentMapper;
import com.engine.salary.mapper.siarchives.FundSchemeMapper;
import com.engine.salary.mapper.siarchives.OtherSchemeMapper;
import com.engine.salary.mapper.siarchives.SocialSchemeMapper;
import com.engine.salary.mapper.sicategory.ICategoryMapper;
import com.engine.salary.mapper.sischeme.InsuranceSchemeDetailMapper;
import com.engine.salary.util.SalaryAssert;
import com.engine.salary.util.SalaryDateUtil;
import com.engine.salary.util.SalaryFormItemUtil;
import com.engine.salary.mapper.sischeme.InsuranceSchemeMapper;
import com.engine.salary.util.*;
import com.engine.salary.util.page.PageInfo;
import com.engine.salary.util.page.PageUtil;
import org.apache.ibatis.session.SqlSession;
import weaver.conn.mybatis.MyBatisFactory;
import weaver.general.Util;
@ -44,6 +44,7 @@ import weaver.hrm.User;
import java.time.LocalDateTime;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
@ -329,7 +330,7 @@ public class SIArchivesBiz {
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
try {
OtherSchemeMapper otherSchemeMapper = sqlSession.getMapper(OtherSchemeMapper.class);
InsuranceArchivesOtherSchemePO insuranceArchivesOtherSchemePO = otherSchemeMapper.getOtherByEmployeeId(employeeId);
InsuranceArchivesOtherSchemePO insuranceArchivesOtherSchemePO = otherSchemeMapper.getOtherByEmployeeId(Collections.singletonList(employeeId)).get(0);
InsuranceArchivesOtherSchemeDTO data = InsuranceArchivesBO.convertOtherPOtoDTO(insuranceArchivesOtherSchemePO, employeeId);
if (insuranceArchivesOtherSchemePO == null) {
data.setEmployeeId(employeeId);
@ -353,7 +354,7 @@ public class SIArchivesBiz {
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
try {
FundSchemeMapper fundSchemeMapper = sqlSession.getMapper(FundSchemeMapper.class);
InsuranceArchivesFundSchemePO insuranceArchivesFundSchemePO = fundSchemeMapper.getFundByEmployeeId(employeeId);
InsuranceArchivesFundSchemePO insuranceArchivesFundSchemePO = fundSchemeMapper.getFundByEmployeeId(Collections.singletonList(employeeId)).get(0);
InsuranceArchivesFundSchemeDTO data = InsuranceArchivesBO.convertFundPOtoDTO(insuranceArchivesFundSchemePO, employeeId);
if (insuranceArchivesFundSchemePO == null) {
data.setEmployeeId(employeeId);
@ -392,7 +393,7 @@ public class SIArchivesBiz {
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
try {
SocialSchemeMapper socialSchemeMapper = sqlSession.getMapper(SocialSchemeMapper.class);
return socialSchemeMapper.getSocialByEmployeeId(employeeId);
return socialSchemeMapper.getSocialByEmployeeId(Collections.singletonList(employeeId)).get(0);
}finally {
sqlSession.close();
}
@ -542,4 +543,280 @@ public class SIArchivesBiz {
sqlSession.close();
}
}
/**
* 档案列表
* <p>
* 这里是一个含有比较多动态字段的列表用的是手动拼装的方式
* @param param 高级搜索条件
* @param operateId 操作员id
* @return table
*/
public Map<String, Object> listPage(InsuranceArchivesListParam param, long operateId) {
Map<String, Object> apidatas = new HashMap<>(16);
InsuranceArchivesListParam request = InsuranceArchivesListParam.builder().build();
if (param.getHireDate() != null && param.getHireDate().length == 2) {
param.setHiredateStart(param.getHireDate()[0]);
param.setHiredateEnd(param.getHireDate()[1]);
}
if (param.getDimissionDate() != null && param.getDimissionDate().length == 2) {
param.setDimissionDateStart(param.getDimissionDate()[0]);
param.setDimissionDateEnd(param.getDimissionDate()[1]);
}
long current = param.getCurrent() == null ? 1L : param.getCurrent();
long pageSize = param.getPageSize() == null ? 10 : param.getPageSize();
long startNum = (current - 1) * pageSize;
param.setStartNum(startNum);
param.setPageSize(pageSize);
if (Objects.equals("fromQuickSearch", param.getDataSource())) {
request.setStatuses(param.getStatuses());
request.setKeyword(param.getUserName());
request.setStartNum(param.getStartNum());
request.setPageSize(param.getPageSize());
request.setCurrent(current);
} else {
request = param;
}
apidatas = listPageEmployeePOS(request, operateId);
return apidatas;
}
/**
* 获取员工的基本信息
* <p>
* 此处主要是一个公共接口有多处引用我们薪资系统只保存员工idemployeeId
* 但是页面上需要展示员工的更多信息姓名部门状态
* 所以这里主要是用于接收联表数据的一个接口
*
* @param param 高级搜索条件用于过滤数据
* @param operateId 操作员id
* @return list
*/
public Map<String, Object> listPageEmployeePOS(InsuranceArchivesListParam param, long operateId) {
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
Map<String, Object> datas = new HashMap<>(16);
try {
SocialSchemeMapper socialSchemeMapper = sqlSession.getMapper(SocialSchemeMapper.class);
PageUtil.start(param.getCurrent().intValue(), param.getPageSize().intValue());
List<InsuranceArchivesEmployeePO> page = socialSchemeMapper.listPageEmployeePOS(param);
PageInfo<InsuranceArchivesEmployeePO> pageInfo = new PageInfo<>(page, InsuranceArchivesEmployeePO.class);
List<Map<String, Object>> records = buildTableData(param, page);
datas.put("pageInfo", pageInfo);
datas.put("datas",records);
datas.put("columns",buildWeaTableColumns(page, operateId));
return datas;
}finally {
sqlSession.close();
}
}
/**
*
* @param
* @param operateId
* @return
*/
private List<WeaTableColumn> buildWeaTableColumns(List<InsuranceArchivesEmployeePO> insuranceArchivesEmployeePOS, long operateId) {
Map<Integer, Map<String, String>> titleMap = buildColumnTitle(insuranceArchivesEmployeePOS, operateId);
List<WeaTableColumn> list = new ArrayList<>();
WeaTableColumn nameColumn = new WeaTableColumn( "100px","姓名", "employeeName" );
nameColumn.setFixed("left");
list.add(nameColumn);
list.add(new WeaTableColumn("150px","部门", "departmentName"));
list.add(new WeaTableColumn("150px","手机号", "mobile"));
list.add(new WeaTableColumn("150px","员工状态", "status"));
list.add(new WeaTableColumn("150px","社保方案名称", "socialName"));
titleMap.get(WelfareTypeEnum.SOCIAL_SECURITY.getValue()).forEach((k, v) -> list.add(new WeaTableColumn(v, k, "150px")));
list.add(new WeaTableColumn("150px","社保账号", "socialAccount"));
list.add(new WeaTableColumn("150px","社保起始缴纳月", "socialStartTime"));
list.add(new WeaTableColumn("150px","社保最后缴纳月", "socialEndTime"));
list.add(new WeaTableColumn("150px","公积金方案名称", "fundName"));
list.add(new WeaTableColumn("150px","公积金账号", "fundAccount"));
titleMap.get(WelfareTypeEnum.ACCUMULATION_FUND.getValue()).forEach((k, v) -> list.add(new WeaTableColumn(v, k, "150px")));
list.add(new WeaTableColumn("150px","补充公积金账号", "supplementFundAccount" ));
list.add(new WeaTableColumn("150px","公积金起始缴纳月", "fundStartTime"));
list.add(new WeaTableColumn("150px","公积金最后缴纳月", "fundEndTime"));
list.add(new WeaTableColumn("150px","其他福利方案名称", "otherName"));
titleMap.get(WelfareTypeEnum.OTHER.getValue()).forEach((k, v) -> list.add(new WeaTableColumn(v, k, "150px")));
list.add(new WeaTableColumn("150px","其他福利起始缴纳月", "otherStartTime"));
list.add(new WeaTableColumn("150px","其他福利最后缴纳月", "otherEndTime"));
return list;
}
/**
*
* @param insuranceArchivesEmployeePOS
* @param operateId
* @return
*/
public Map<Integer, Map<String, String>> buildColumnTitle(List<InsuranceArchivesEmployeePO> insuranceArchivesEmployeePOS, long operateId) {
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
Map<Integer, Map<String, String>> result = new HashMap<>();
try {
SocialSchemeMapper socialSchemeMapper = sqlSession.getMapper(SocialSchemeMapper.class);
FundSchemeMapper fundSchemeMapper = sqlSession.getMapper(FundSchemeMapper.class);
OtherSchemeMapper otherSchemeMapper = sqlSession.getMapper(OtherSchemeMapper.class);
ICategoryMapper iCategoryMapper = sqlSession.getMapper(ICategoryMapper.class);
Set<String> socialSet = new HashSet<>();
Set<String> fundSet = new HashSet<>();
Set<String> otherSet = new HashSet<>();
insuranceArchivesEmployeePOS.forEach(item -> {
InsuranceArchivesSocialSchemePO socialItem = socialSchemeMapper.getSocialByEmployeeId(Collections.singletonList(item.getEmployeeId())).get(0);
InsuranceArchivesFundSchemePO fundItem = fundSchemeMapper.getFundByEmployeeId(Collections.singletonList(item.getEmployeeId())).get(0);
InsuranceArchivesOtherSchemePO otherItem = otherSchemeMapper.getOtherByEmployeeId(Collections.singletonList(item.getEmployeeId())).get(0);
if (socialItem != null) {
Map<String, Object> socialJson = JSON.parseObject(socialItem.getSocialPaymentBaseString(), new TypeReference<Map<String, Object>>() {
});
if (socialJson != null) {
socialJson.forEach((k, v) -> socialSet.add(k));
}
}
if (fundItem != null) {
Map<String, Object> fundJson = JSON.parseObject(fundItem.getFundPaymentBaseString(), new TypeReference<Map<String, Object>>() {
});
if (fundJson != null) {
fundJson.forEach((k, v) -> fundSet.add(k));
}
}
if (otherItem != null) {
Map<String, Object> otherJson = JSON.parseObject(otherItem.getOtherPaymentBaseString(), new TypeReference<Map<String, Object>>() {
});
if (otherJson != null) {
otherJson.forEach((k, v) -> otherSet.add(k));
}
}
});
Map<String, String> socialMap = new HashMap<>();
Map<Long, ICategoryPO> socialCollect = new HashMap<>();
Map<Long, ICategoryPO> customSocial = iCategoryMapper.listByWelfareType(WelfareTypeEnum.SOCIAL_SECURITY.getValue(),null)
.stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity()));
Map<Long, ICategoryPO> sysSocial = iCategoryMapper.listByWelfareType(WelfareTypeEnum.SOCIAL_SECURITY.getValue(),DataTypeEnum.SYSTEM.getValue())
.stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity()));
socialCollect.putAll(customSocial);
socialCollect.putAll(sysSocial);
socialSet.forEach(item -> {
if (socialCollect.containsKey(Long.valueOf(item))) {
socialMap.put(item, socialCollect.get(Long.valueOf(item)).getInsuranceName() + "申报基数");
}
});
Map<String, String> fundMap = new HashMap<>();
Map<Long, ICategoryPO> fundCollect = new HashMap<>();
Map<Long, ICategoryPO> customFund = iCategoryMapper.listByWelfareType(WelfareTypeEnum.ACCUMULATION_FUND.getValue(),null).stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity()));
Map<Long, ICategoryPO> sysFund = iCategoryMapper.listByWelfareType(WelfareTypeEnum.ACCUMULATION_FUND.getValue(),DataTypeEnum.SYSTEM.getValue()).stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity()));
fundCollect.putAll(customFund);
fundCollect.putAll(sysFund);
fundSet.forEach(item -> {
if (fundCollect.containsKey(Long.valueOf(item))) {
fundMap.put(item, fundCollect.get(Long.valueOf(item)).getInsuranceName() + "申报基数");
}
});
Map<String, String> otherMap = new HashMap<>();
Map<Long, ICategoryPO> otherCollect = new HashMap<>();
Map<Long, ICategoryPO> customOther = iCategoryMapper.listByWelfareType(WelfareTypeEnum.OTHER.getValue(),null).stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity()));
Map<Long, ICategoryPO> sysOther = iCategoryMapper.listByWelfareType(WelfareTypeEnum.OTHER.getValue(),DataTypeEnum.SYSTEM.getValue()).stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity()));
otherCollect.putAll(customOther);
otherCollect.putAll(sysOther);
otherSet.forEach(item -> {
if (otherCollect.containsKey(Long.valueOf(item))) {
otherMap.put(item, otherCollect.get(Long.valueOf(item)).getInsuranceName() + "申报基数");
}
});
result.put(WelfareTypeEnum.SOCIAL_SECURITY.getValue(), socialMap);
result.put(WelfareTypeEnum.ACCUMULATION_FUND.getValue(), fundMap);
result.put(WelfareTypeEnum.OTHER.getValue(), otherMap);
return result;
}finally {
sqlSession.close();
}
}
/**
*
* @param param
* @param insuranceArchivesEmployeePOS
* @return
*/
private List<Map<String, Object>> buildTableData(InsuranceArchivesListParam param, List<InsuranceArchivesEmployeePO> insuranceArchivesEmployeePOS) {
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
List<Map<String, Object>> records = new ArrayList<>();
try {
SocialSchemeMapper socialSchemeMapper = sqlSession.getMapper(SocialSchemeMapper.class);
FundSchemeMapper fundSchemeMapper = sqlSession.getMapper(FundSchemeMapper.class);
OtherSchemeMapper otherSchemeMapper = sqlSession.getMapper(OtherSchemeMapper.class);
InsuranceSchemeMapper insuranceSchemeMapper = sqlSession.getMapper(InsuranceSchemeMapper.class);
List<Long> employeeIds = insuranceArchivesEmployeePOS.stream().map(InsuranceArchivesEmployeePO::getEmployeeId).collect(Collectors.toList());
Map<Long, InsuranceArchivesSocialSchemePO> socialSchemePOMap = socialSchemeMapper.getSocialByEmployeeId(employeeIds)
.stream().collect(Collectors.toMap(InsuranceArchivesSocialSchemePO::getEmployeeId, Function.identity()));
Map<Long, InsuranceArchivesFundSchemePO> fundSchemePOMap = fundSchemeMapper.getFundByEmployeeId(employeeIds)
.stream().collect(Collectors.toMap(InsuranceArchivesFundSchemePO::getEmployeeId, Function.identity()));
Map<Long, InsuranceArchivesOtherSchemePO> otherSchemePOMap = otherSchemeMapper.getOtherByEmployeeId(employeeIds)
.stream().collect(Collectors.toMap(InsuranceArchivesOtherSchemePO::getEmployeeId, Function.identity()));
insuranceArchivesEmployeePOS.forEach(item -> {
InsuranceArchivesSocialSchemePO socialItem = socialSchemePOMap.get(item.getEmployeeId());
InsuranceArchivesFundSchemePO fundItem = fundSchemePOMap.get(item.getEmployeeId());
InsuranceArchivesOtherSchemePO otherItem = otherSchemePOMap.get(item.getEmployeeId());
Map<String, Object> map = new HashMap<>();
map.put("employeeName", item.getUserName());
map.put("employeeId", item.getEmployeeId());
map.put("departmentName", item.getDepartmentName());
map.put("departmentId", item.getDepartmentId());
map.put("jobNum", item.getJobNum());
map.put("mobile", item.getTelephone());
map.put("status", item.getUserStatus() == null ? "" : item.getUserStatus().getDescription());
if (socialItem != null) {
map.put("socialName", insuranceSchemeMapper.querySchemeName(socialItem.getSocialSchemeId()));
Map<String, Object> socialJson = JSON.parseObject(socialItem.getSocialPaymentBaseString(), new TypeReference<Map<String, Object>>() {
});
if (socialJson != null) {
SalaryEntityUtil.thousandthConvert(socialJson, map);
}
map.put("socialAccount", socialItem.getSocialAccount());
map.put("socialStartTime", socialItem.getSocialStartTime());
map.put("socialEndTime", socialItem.getSocialEndTime());
}
if (fundItem != null) {
map.put("fundName", insuranceSchemeMapper.querySchemeName(fundItem.getFundSchemeId()));
map.put("fundAccount", fundItem.getFundAccount());
Map<String, Object> fundJson = JSON.parseObject(fundItem.getFundPaymentBaseString(), new TypeReference<Map<String, Object>>() {
});
if (fundJson != null) {
SalaryEntityUtil.thousandthConvert(fundJson, map);
}
map.put("supplementFundAccount", fundItem.getSupplementFundAccount());
map.put("fundStartTime", fundItem.getFundStartTime());
map.put("fundEndTime", fundItem.getFundEndTime());
}
if (otherItem != null) {
map.put("otherName", insuranceSchemeMapper.querySchemeName(otherItem.getOtherSchemeId()));
Map<String, Object> otherJson = JSON.parseObject(otherItem.getOtherPaymentBaseString(), new TypeReference<Map<String, Object>>() {
});
if (otherJson != null) {
SalaryEntityUtil.thousandthConvert(otherJson, map);
}
map.put("otherStartTime", otherItem.getOtherStartTime());
map.put("otherEndTime", otherItem.getOtherEndTime());
}
records.add(map);
});
return records;
}finally {
sqlSession.close();
}
}
}

View File

@ -36,7 +36,7 @@ import java.util.stream.Collectors;
* @Date 2022/3/7
* @Version V1.0
**/
public class SISchemeBiz {
public class SISchemeBiz {
/**
@ -129,7 +129,7 @@ public class SISchemeBiz {
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
try {
ICategoryMapper iCategoryMapper = sqlSession.getMapper(ICategoryMapper.class);
List<ICategoryPO> insuranceCategoryPOS = iCategoryMapper.listByWelfareType(welfareType);
List<ICategoryPO> insuranceCategoryPOS = iCategoryMapper.listByWelfareType(welfareType,null);
return insuranceCategoryPOS;
} finally {
sqlSession.close();

View File

@ -0,0 +1,22 @@
package com.engine.salary.common;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @Author weaver_cl
* @Description: TODO 基础查询参数
* @Date 2022/3/17
* @Version V1.0
**/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class BaseQueryParam {
//当前页码
private Long current = 1L;
//每页数据条数
private Long pageSize = 10L;
}

View File

@ -1,5 +1,8 @@
package com.engine.salary.demo;
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;
@ -10,9 +13,7 @@ import org.apache.ibatis.session.SqlSession;
import weaver.conn.mybatis.MyBatisFactory;
import weaver.hrm.User;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
public class DemoPageCmd extends AbstractCommonCommand<Map<String, Object>> {
@ -36,6 +37,21 @@ public class DemoPageCmd extends AbstractCommonCommand<Map<String, Object>> {
List<DemoPo> page = mapper.page();
PageInfo<DemoPo> pageInfo = new PageInfo<>(page, DemoPo.class);
apidatas.put("pageInfo", pageInfo);
WeaTable weaTable = new WeaTable();
List<WeaTableColumn> weaTableColumns = Arrays.asList(new WeaTableColumn("10%","主键","id"),
new WeaTableColumn("10%","姓名","name"));
weaTable.setSqlwhere("select * from hrsa_tax_rate_base");
weaTable.setColumns(weaTableColumns);
WeaResultMsg result = new WeaResultMsg(false);
result.putAll(weaTable.makeDataResult());
result.success();
apidatas.put("columns",weaTableColumns);
apidatas.put("datakey",result.getResultMap());
} finally {
sqlSession.close();
}

View File

@ -5,8 +5,8 @@ import lombok.Data;
@Data
public class DemoPo {
@TableTitle(title = "序号", key = "id", dataIndex = "id")
//@TableTitle(title = "序号", key = "id", dataIndex = "id")
Long id;
@TableTitle(title = "名称", key = "name", dataIndex = "name")
//@TableTitle(title = "名称", key = "name", dataIndex = "name")
String name;
}

View File

@ -0,0 +1,93 @@
package com.engine.salary.entity.siarchives.param;
import com.engine.salary.common.BaseQueryParam;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
* @Author weaver_cl
* @Description: TODO 高级查询档案列表
* @Date 2022/3/17
* @Version V1.0
**/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class InsuranceArchivesListParam extends BaseQueryParam {
//姓名
private String userName;
//工号")
private String jobNum;
//部门(多选)")
private List<BigDecimal> departmentIds;
//状态(多线)")
private List<String> statuses;
//岗位(多选)")
private List<BigDecimal> positions;
//入职时间")
private Date[] hireDate;
//离职时间")
private Date[] dimissionDate;
//入职开始时间")
private Date hiredateStart;
//入职结束时间")
private Date hiredateEnd;
//离职开始时间")
private Date dimissionDateStart;
//离职结束时间")
private Date dimissionDateEnd;
//社保方案id")
private Long siSchemeId;
//公积金方案id")
private Long fundSchemeId;
//其他福利方案id")
private Long otherSchemeId;
//导出档案员工id集合")
private List<Long> employeeIds;
//分页起始索引")
private Long startNum;
//快捷搜索")
private String keyword;
//快捷搜索和高级搜索标识")
private String dataSource;
//是否导出原有数据")
private Boolean exportData;
//是否导出所有核酸异常数据")
private Boolean inspectAll;
//主键id集合")
private List<Long> ids;
//账单月份")
private String billMonth;
//是否导出模板")
private Boolean templateFlag;
}

View File

@ -0,0 +1,48 @@
package com.engine.salary.entity.siarchives.po;
import com.engine.salary.enums.UserStatus;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.math.BigDecimal;
import java.util.Date;
/**
* @Author weaver_cl
* @Description: TODO
* @Date 2022/3/17
* @Version V1.0
**/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class InsuranceArchivesEmployeePO {
private Long employeeId;//员工id
private String userName;
private BigDecimal departmentId;
private String jobNum;
private String telephone;
private String departmentName;
private BigDecimal position;
private UserStatus userStatus;
private Date hiredate;
private Date dimissionDate;
private Long siSchemeId;
private Long fundSchemeId;
private Long otherSchemeId;
}

View File

@ -0,0 +1,44 @@
package com.engine.salary.enums;
/**
* @Author weaver_cl
* @Description: TODO
* @Date 2022/3/17
* @Version V1.0
* The trial
* A formal
* temporary
* Try to postpone the
* fire
* departure
* retired
* invalid
**/
public enum UserStatus {
TRIAL(0,"试用"),
FORMAL(1,"正式"),
TEMPORARY(2,"临时"),
DELAY(3,"试用延期"),
FIRE(4,"解雇"),
DEPARTURE(5,"离职"),
RETIRED(6,"退休"),
INVALID(7,"无效");
private Integer value;
private String description;
UserStatus(Integer value, String description) {
this.value = value;
this.description = description;
}
public String getDescription() {
return this.description;
}
public Integer getValue() {
return value;
}
}

View File

@ -19,7 +19,7 @@ public interface FundSchemeMapper {
* @param employeeId
* @return
*/
InsuranceArchivesFundSchemePO getFundByEmployeeId(@Param("employeeId")Long employeeId);
List<InsuranceArchivesFundSchemePO> getFundByEmployeeId(@Param("employeeIds")List<Long> employeeId);
/**
* 批量删除

View File

@ -43,12 +43,16 @@
</sql>
<!-- 根据人员获取单条记录 -->
<!-- 根据人员获取记录 -->
<select id="getFundByEmployeeId" resultMap="BaseResultMap" >
SELECT
<include refid="baseColumns"/>
FROM hrsa_fund_archives t
WHERE employee_id = #{employeeId} AND delete_type = 0
WHERE delete_type = 0
AND employee_id IN
<foreach collection="employeeIds" open="(" item="employeeIds" separator="," close=")">
#{employeeIds}
</foreach>
</select>
<!-- 批量删除 -->

View File

@ -19,7 +19,7 @@ public interface OtherSchemeMapper {
* @param employeeId
* @return
*/
InsuranceArchivesOtherSchemePO getOtherByEmployeeId(@Param("employeeId")Long employeeId);
List<InsuranceArchivesOtherSchemePO> getOtherByEmployeeId(@Param("employeeIds")List<Long> employeeId);
/**
* 批量删除

View File

@ -41,12 +41,16 @@
</sql>
<!-- 根据人员获取单条记录 -->
<!-- 根据人员获取记录 -->
<select id="getOtherByEmployeeId" resultMap="BaseResultMap" >
SELECT
<include refid="baseColumns"/>
FROM hrsa_other_archives t
WHERE employee_id = #{employeeId} AND delete_type = 0
WHERE delete_type = 0
AND employee_id IN
<foreach collection="employeeIds" open="(" item="employeeIds" separator="," close=")">
#{employeeIds}
</foreach>
</select>

View File

@ -1,5 +1,7 @@
package com.engine.salary.mapper.siarchives;
import com.engine.salary.entity.siarchives.param.InsuranceArchivesListParam;
import com.engine.salary.entity.siarchives.po.InsuranceArchivesEmployeePO;
import com.engine.salary.entity.siarchives.po.InsuranceArchivesSocialSchemePO;
import org.apache.ibatis.annotations.Param;
@ -19,7 +21,7 @@ public interface SocialSchemeMapper {
* @param employeeId
* @return
*/
InsuranceArchivesSocialSchemePO getSocialByEmployeeId(@Param("employeeId")Long employeeId);
List<InsuranceArchivesSocialSchemePO> getSocialByEmployeeId(@Param("employeeIds")List<Long> employeeId);
/**
* 批量删除
@ -32,4 +34,11 @@ public interface SocialSchemeMapper {
* @param singletonList
*/
void batchSave(@Param("socialSchemePOS") List<InsuranceArchivesSocialSchemePO> singletonList);
/**
*
* @param param
* @return
*/
List<InsuranceArchivesEmployeePO> listPageEmployeePOS(@Param("param") InsuranceArchivesListParam param);
}

View File

@ -41,12 +41,16 @@
</sql>
<!-- 根据人员获取单条记录 -->
<!-- 根据人员id获取记录 -->
<select id="getSocialByEmployeeId" resultMap="BaseResultMap" >
SELECT
<include refid="baseColumns"/>
FROM hrsa_social_archives t
WHERE employee_id = #{employeeId} AND delete_type = 0
WHERE delete_type = 0
AND employee_id IN
<foreach collection="employeeIds" open="(" item="employeeIds" separator="," close=")">
#{employeeIds}
</foreach>
</select>
<!-- 批量删除 -->
@ -176,7 +180,99 @@
</insert>
<!-- 人员档案信息 -->
<sql id="paramSql">
<!-- 关键字(姓名、工号 -->
<if test="param.keyword != null and param.keyword != ''">
AND
(
a.lastname like CONCAT('%',#{param.keyword},'%')
OR a.workcode like CONCAT('%',#{param.keyword},'%')
)
</if>
</sql>
<sql id="paramSql" databaseId="oracle">
<if test="param.keyword != null and param.keyword != ''">
AND
(
e.lastname like '%'||#{param.keyword}||'%'
OR e.workcode like '%'||#{param.keyword}||'%'
)
</if>
</sql>
<sql id="paramSql" databaseId="sqlserver">
<if test="param.keyword != null and param.keyword != ''">
AND
(
e.lastname like '%'+#{param.keyword}+'%'
OR e.workcode like '%'+#{param.keyword}+'%'
)
</if>
</sql>
<sql id="paramSqlCommon">
<!--部门 多选-->
<if test="param.departmentIds != null and param.departmentIds.size()>0">
AND a.departmentid IN
<foreach collection="param.departmentIds" open="(" item="departmentId" separator="," close=")">
#{departmentId}
</foreach>
</if>
<!--状态 多选-->
<if test="param.statuses != null and param.statuses.size()>0">
AND a.status IN
<foreach collection="param.statuses" open="(" item="status" separator="," close=")">
#{status}
</foreach>
</if>
<!--岗位 多选-->
<if test="param.positions != null and param.positions.size()>0">
AND a.jobtitle IN
<foreach collection="param.positions" open="(" item="position" separator="," close=")">
#{position}
</foreach>
</if>
<!--入职日期-->
<if test="param.hiredateStart != null and param.hiredateEnd != null">
AND a.companystartdate between #{param.hiredateStart} and #{param.hiredateEnd}
</if>
<!--离职日期-->
<if test="param.dimissionDateStart != null and param.dimissionDateEnd != null">
AND f.dismissdate between #{param.dimissionDateStart} and #{param.dimissionDateEnd}
</if>
<!--方案主键-->
<if test ="param.siSchemeId != null">
AND c.social_scheme_id = #{param.siSchemeId}
</if>
<if test ="param.fundSchemeId != null">
AND d.fund_scheme_id = #{param.fundSchemeId}
</if>
<if test ="param.otherSchemeId != null">
AND e.other_scheme_id = #{param.otherSchemeId}
</if>
</sql>
<select id="listPageEmployeePOS" resultType="com.engine.salary.entity.siarchives.po.InsuranceArchivesEmployeePO">
SELECT
a.id as employeeId,
a.lastname as userName,
b.departmentname as departmentName,
a.mobile as telephone
FROM
hrmresource a
LEFT JOIN hrmdepartment b ON a.departmentid = b.id
LEFT JOIN hrsa_social_archives c ON a.id = c.employee_id
LEFT JOIN hrsa_fund_archives d ON a.id = d.employee_id
LEFT JOIN hrsa_other_archives e ON a.id = e.employee_id
LEFT JOIN bill_hrmdismiss f on a.id = f.resource_n
WHERE
1 = 1
<include refid="paramSql"/>
<include refid="paramSqlCommon"/>
ORDER BY a.id asc
</select>
</mapper>

View File

@ -64,5 +64,6 @@ public interface ICategoryMapper {
*
* @return
*/
List<ICategoryPO> listByWelfareType(@Param("welfareType") Integer welfareType);
List<ICategoryPO> listByWelfareType(@Param("welfareType") Integer welfareType,
@Param("dataType") Integer dataType);
}

View File

@ -30,6 +30,11 @@
, t.tenant_key
</sql>
<sql id="paramSql">
<if test="dataType != null and dataType != ''">
AND data_type = #{dataType}
</if>
</sql>
<!-- 根据主键获取单条记录 -->
<select id="getById" resultMap="BaseResultMap" parameterType="Long">
@ -81,11 +86,14 @@
ORDER BY id DESC
</select>
<select id="listByWelfareType" resultMap="BaseResultMap">
SELECT
<include refid="baseColumns"/>
FROM hrsa_insurance_category t
WHERE welfare_type= #{welfareType} AND delete_type = 0
<include refid="paramSql"/>
ORDER BY id DESC
</select>

View File

@ -1,6 +1,7 @@
package com.engine.salary.mapper.sischeme;
import com.engine.salary.entity.sischeme.po.InsuranceSchemePO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@ -48,4 +49,10 @@ public interface InsuranceSchemeMapper {
List<InsuranceSchemePO> listAll();
/**
* 获取名称
* @param schemeId
* @return
*/
String querySchemeName(@Param("schemeId") Long schemeId);
}

View File

@ -41,6 +41,15 @@
WHERE id = #{id} AND delete_type = 0
</select>
<!-- 根据主键获取名称 -->
<select id="querySchemeName">
SELECT
scheme_name
FROM hrsa_social_security_scheme
WHERE id = #{schemeId}
</select>
<!-- 根据名称获取记录 -->
<select id="listByName" resultMap="BaseResultMap">
SELECT

View File

@ -1,5 +1,6 @@
package com.engine.salary.service;
import com.engine.salary.entity.siarchives.param.InsuranceArchivesListParam;
import com.engine.salary.entity.siarchives.param.InsuranceArchivesSaveParam;
import java.util.Map;
@ -19,4 +20,6 @@ public interface SIArchivesService {
Map<String, Object> getPaymentForm(Map<String, Object> params);
String insert(InsuranceArchivesSaveParam param);
Map<String, Object> listPage(InsuranceArchivesListParam insuranceArchivesListParam);
}

View File

@ -3,12 +3,10 @@ package com.engine.salary.service.impl;
import com.engine.core.impl.Service;
import com.engine.salary.biz.SIArchivesBiz;
import com.engine.salary.cmd.siarchives.SIArchivesTipsCmd;
import com.engine.salary.entity.siarchives.param.InsuranceArchivesListParam;
import com.engine.salary.entity.siarchives.param.InsuranceArchivesSaveParam;
import com.engine.salary.enums.sicategory.WelfareTypeEnum;
import com.engine.salary.exception.SalaryRunTimeException;
import com.engine.salary.service.SIArchivesService;
import com.engine.salary.util.SalaryAssert;
import com.engine.salary.util.SalaryI18nUtil;
import weaver.general.Util;
import java.util.HashMap;
@ -55,4 +53,14 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService
siArchivesBiz.insert(param,(long) user.getUID());
return null;
}
@Override
public Map<String, Object> listPage(InsuranceArchivesListParam param) {
Map<String, Object> apidatas = new HashMap<>(16);
SIArchivesBiz siArchivesBiz = new SIArchivesBiz();
apidatas = siArchivesBiz.listPage(param,(long) user.getUID());
return apidatas;
}
}

View File

@ -2,6 +2,7 @@ package com.engine.salary.web;
import com.engine.common.util.ParamUtil;
import com.engine.common.util.ServiceUtil;
import com.engine.salary.entity.siarchives.param.InsuranceArchivesListParam;
import com.engine.salary.entity.siarchives.param.InsuranceArchivesSaveParam;
import com.engine.salary.enums.sicategory.WelfareTypeEnum;
import com.engine.salary.service.SIArchivesService;
@ -92,5 +93,22 @@ public class SIArchivesController {
return new ResponseResult<InsuranceArchivesSaveParam,String>().run(getService(user)::insert, param);
}
/**
* 查询档案列表
* @param request
* @param response
* @param param
* @return
*/
@POST
@Path("/getTable")
@Produces(MediaType.APPLICATION_JSON)
public String getTable(@Context HttpServletRequest request, @Context HttpServletResponse response,@RequestBody InsuranceArchivesListParam param) {
User user = HrmUserVarify.getUser(request, response);
return new ResponseResult<InsuranceArchivesListParam,Map<String,Object>>().run(getService(user)::listPage, param);
}
}