福利台账导出及列表bug修复

This commit is contained in:
Chengliang 2022-04-19 17:46:24 +08:00
parent 0feadcf0b2
commit bef9b30a2e
12 changed files with 475 additions and 127 deletions

15
.gitignore vendored Normal file
View File

@ -0,0 +1,15 @@
/weaver-hrm-salary.iml
/out/
/.idea/
HELP.md
target/
### IntelliJ IDEA ###
.idea
/src/test
/src/META-INF
/log

View File

@ -94,7 +94,7 @@
, t.tenant_key
</sql>
<sql id="paramSql">
<sql id="paramSqlCommon" >
<if test="param.billMonth != null and param.billMonth != ''">
AND
t.bill_month = #{param.billMonth}
@ -103,13 +103,33 @@
AND
t.payment_status = #{param.paymentStatus}
</if>
<if test="param.employeeIds != null and param.employeeIds.size()>0">
AND t.employee_id IN
<foreach collection="param.employeeIds" open="(" item="employeeId" separator="," close=")">
#{employeeId}
</foreach>
</sql>
<sql id="paramSql">
<if test="param.userName != null and param.userName != ''">
AND
(
e.lastname like CONCAT('%',#{param.userName},'%')
)
</if>
</sql>
<sql id="paramSql" databaseId="oracle">
<if test="param.userName != null and param.userName != ''">
AND
(
e.lastname like '%'||#{param.userName}||'%'
)
</if>
</sql>
<sql id="paramSql" databaseId="sqlserver">
<if test="param.userName != null and param.userName != ''">
AND
(
e.lastname like '%'+#{param.userName}+'%'
)
</if>
</sql>
<select id="list" resultMap="BaseResultMap">
@ -117,7 +137,10 @@
<include refid="baseColumns"/>
FROM
hrsa_bill_detail t
left join hrmresource e
on e.ID = t.employee_id
WHERE t.delete_type = 0
<include refid="paramSqlCommon"/>
<include refid="paramSql"/>
ORDER BY t.update_time DESC
</select>
@ -415,28 +438,28 @@
FROM
(
SELECT
e.username AS userName,
e.JOB_NUM AS jobNum,
e.DEPARTMENT AS departmentId,
d.`NAME` AS departmentName,
e.lastname AS userName,
e.jobtitle AS jobNum,
e.departmentid AS departmentId,
d.departmentname AS departmentName,
e.`STATUS` AS userStatus,
e.POSITION AS position,
e.jobtitle AS position,
h.payment_status AS paymentStatus,
e.HIREDATE AS hiredate,
l.DIMISSION_TIME AS dimissionDate,
e.companystartdate AS hiredate,
l.dismissdate AS dimissionDate,
e.ID AS employeeId,
e.MOBILE AS telephone
FROM
hrsa_bill_detail h
LEFT JOIN {$publicdb}.employee e ON e.ID = h.employee_id AND h.delete_type = 0
LEFT JOIN {$publicdb}.dimission_log l ON e.ID = l.DIMISSION_ID
LEFT JOIN {$publicdb}.department d ON d.ID = e.DEPARTMENT
LEFT JOIN hrmresource e ON e.ID = h.employee_id AND h.delete_type = 0
LEFT JOIN bill_hrmdismiss l ON e.ID = l.resource_n
LEFT JOIN hrmdepartment d ON d.ID = e.departmentid
WHERE
e.`STATUS` = 'unavailable' AND h.payment_status = 0
e.`STATUS` = 5 AND h.payment_status = 0
<if test="userName != null and userName != ''">
AND e.username like CONCAT('%',#{userName},'%')
AND e.lastname like CONCAT('%',#{userName},'%')
</if>
AND(l.DIMISSION_TIME IS NOT NULL)
AND(l.dismissdate IS NOT NULL)
)AS t
LEFT JOIN hrsa_social_archives social ON t.employeeId = social.employee_id AND social.delete_type = 0
LEFT JOIN hrsa_fund_archives fund ON t.employeeId = fund.employee_id AND fund.delete_type = 0
@ -494,27 +517,27 @@
FROM
(
SELECT
e.username AS userName,
e.JOB_NUM AS jobNum,
e.DEPARTMENT AS departmentId,
d.`NAME` AS departmentName,
e.lastname AS userName,
e.jobtitle AS jobNum,
e.departmentid AS departmentId,
d.departmentname AS departmentName,
e.`STATUS` AS userStatus,
e.POSITION AS position,
e.HIREDATE AS hiredate,
l.DIMISSION_TIME AS dimissionDate,
e.jobtitle AS position,
e.companystartdate AS hiredate,
l.dismissdate AS dimissionDate,
e.ID AS employeeId,
e.MOBILE AS telephone
FROM
{$publicdb}.employee e
LEFT JOIN {$publicdb}.dimission_log l ON e.ID = l.DIMISSION_ID
LEFT JOIN {$publicdb}.department d ON d.ID = e.DEPARTMENT
hrmresource e
LEFT JOIN bill_hrmdismiss l ON e.ID = l.resource_n
LEFT JOIN hrmdepartment d ON d.ID = e.departmentid
WHERE
e.`STATUS` = 'normal'
e.`STATUS` not in (4,5,6,7)
<if test="userName != null and userName != ''">
AND e.username like CONCAT('%',#{userName},'%')
AND e.lastname like CONCAT('%',#{userName},'%')
</if>
AND(
l.DIMISSION_TIME IS NULL OR l.DIMISSION_TIME = ''
l.dismissdate IS NULL OR l.dismissdate = ''
)
)AS t
LEFT JOIN hrsa_social_archives social ON t.employeeId = social.employee_id AND social.delete_type = 0
@ -584,28 +607,28 @@
FROM
(
SELECT
e.username AS userName,
e.JOB_NUM AS jobNum,
e.DEPARTMENT AS departmentId,
d.NAME AS departmentName,
e.STATUS AS userStatus,
e.POSITION AS position,
e.lastname AS userName,
e.jobtitle AS jobNum,
e.departmentid AS departmentId,
d.departmentname AS departmentName,
e.`STATUS` AS userStatus,
e.jobtitle AS position,
h.payment_status AS paymentStatus,
e.HIREDATE AS hiredate,
l.DIMISSION_TIME AS dimissionDate,
e.companystartdate AS hiredate,
l.dismissdate AS dimissionDate,
e.ID AS employeeId,
e.MOBILE AS telephone
FROM
hrsa_bill_detail h
LEFT JOIN {$publicdb}.employee e ON e.ID = h.employee_id AND h.delete_type = 0
LEFT JOIN {$publicdb}.dimission_log l ON e.ID = l.DIMISSION_ID
LEFT JOIN {$publicdb}.department d ON d.ID = e.DEPARTMENT
LEFT JOIN hrmresource e ON e.ID = h.employee_id AND h.delete_type = 0
LEFT JOIN bill_hrmdismiss l ON e.ID = l.resource_n
LEFT JOIN hrmdepartment d ON d.ID = e.departmentid
WHERE
e.STATUS = 'unavailable' AND h.payment_status = 0
e.STATUS = 5 AND h.payment_status = 0
<if test="userName != null and userName != ''">
AND e.username like '%'||#{userName}||'%'
AND e.lastname like '%'||#{userName}||'%'
</if>
AND(l.DIMISSION_TIME IS NOT NULL)
AND(l.dismissdate IS NOT NULL)
)AS t
LEFT JOIN hrsa_social_archives social ON t.employeeId = social.employee_id AND social.delete_type = 0
LEFT JOIN hrsa_fund_archives fund ON t.employeeId = fund.employee_id AND fund.delete_type = 0
@ -663,27 +686,27 @@
FROM
(
SELECT
e.username AS userName,
e.JOB_NUM AS jobNum,
e.DEPARTMENT AS departmentId,
d.NAME AS departmentName,
e.STATUS AS userStatus,
e.POSITION AS position,
e.HIREDATE AS hiredate,
l.DIMISSION_TIME AS dimissionDate,
e.lastname AS userName,
e.jobtitle AS jobNum,
e.departmentid AS departmentId,
d.departmentname AS departmentName,
e.`STATUS` AS userStatus,
e.jobtitle AS position,
e.companystartdate AS hiredate,
l.dismissdate AS dimissionDate,
e.ID AS employeeId,
e.MOBILE AS telephone
FROM
{$publicdb}.employee e
LEFT JOIN {$publicdb}.dimission_log l ON e.ID = l.DIMISSION_ID
LEFT JOIN {$publicdb}.department d ON d.ID = e.DEPARTMENT
hrmresource e
LEFT JOIN bill_hrmdismiss l ON e.ID = l.resource_n
LEFT JOIN hrmdepartment d ON d.ID = e.departmentid
WHERE
e.STATUS = 'normal'
e.STATUS not in (4,5,6,7)
<if test="userName != null and userName != ''">
AND e.username like '%'||#{userName}||'%'
AND e.lastname like '%'||#{userName}||'%'
</if>
AND(
l.DIMISSION_TIME IS NULL OR l.DIMISSION_TIME = ''
l.dismissdate IS NULL OR l.dismissdate = ''
)
)AS t
LEFT JOIN hrsa_social_archives social ON t.employeeId = social.employee_id AND social.delete_type = 0
@ -754,28 +777,28 @@
FROM
(
SELECT
e.username AS userName,
e.JOB_NUM AS jobNum,
e.DEPARTMENT AS departmentId,
d.NAME AS departmentName,
e.STATUS AS userStatus,
e.POSITION AS position,
e.lastname AS userName,
e.jobtitle AS jobNum,
e.departmentid AS departmentId,
d.departmentname AS departmentName,
e.`STATUS` AS userStatus,
e.jobtitle AS position,
h.payment_status AS paymentStatus,
e.HIREDATE AS hiredate,
l.DIMISSION_TIME AS dimissionDate,
e.companystartdate AS hiredate,
l.dismissdate AS dimissionDate,
e.ID AS employeeId,
e.MOBILE AS telephone
FROM
hrsa_bill_detail h
LEFT JOIN {$publicdb}.employee e ON e.ID = h.employee_id AND h.delete_type = 0
LEFT JOIN {$publicdb}.dimission_log l ON e.ID = l.DIMISSION_ID
LEFT JOIN {$publicdb}.department d ON d.ID = e.DEPARTMENT
LEFT JOIN hrmresource e ON e.ID = h.employee_id AND h.delete_type = 0
LEFT JOIN bill_hrmdismiss l ON e.ID = l.resource_n
LEFT JOIN hrmdepartment d ON d.ID = e.departmentid
WHERE
e.STATUS = 'unavailable' AND h.payment_status = 0
e.STATUS = '5' AND h.payment_status = 0
<if test="userName != null and userName != ''">
AND e.username like '%'+#{userName}+'%'
AND e.lastname like '%'+#{userName}+'%'
</if>
AND(l.DIMISSION_TIME IS NOT NULL)
AND(l.dismissdate IS NOT NULL)
)AS t
LEFT JOIN hrsa_social_archives social ON t.employeeId = social.employee_id AND social.delete_type = 0
LEFT JOIN hrsa_fund_archives fund ON t.employeeId = fund.employee_id AND fund.delete_type = 0
@ -833,27 +856,27 @@
FROM
(
SELECT
e.username AS userName,
e.JOB_NUM AS jobNum,
e.DEPARTMENT AS departmentId,
d.NAME AS departmentName,
e.STATUS AS userStatus,
e.POSITION AS position,
e.HIREDATE AS hiredate,
l.DIMISSION_TIME AS dimissionDate,
e.lastname AS userName,
e.jobtitle AS jobNum,
e.departmentid AS departmentId,
d.departmentname AS departmentName,
e.`STATUS` AS userStatus,
e.jobtitle AS position,
e.companystartdate AS hiredate,
l.dismissdate AS dimissionDate,
e.ID AS employeeId,
e.MOBILE AS telephone
FROM
{$publicdb}.employee e
LEFT JOIN {$publicdb}.dimission_log l ON e.ID = l.DIMISSION_ID
LEFT JOIN {$publicdb}.department d ON d.ID = e.DEPARTMENT
hrmresource e
LEFT JOIN bill_hrmdismiss l ON e.ID = l.resource_n
LEFT JOIN hrmdepartment d ON d.ID = e.departmentid
WHERE
e.STATUS = 'normal'
e.STATUS not in (4,5,6,7)
<if test="userName != null and userName != ''">
AND e.username like '%'+#{userName}+'%'
AND e.lastname like '%'+#{userName}+'%'
</if>
AND(
l.DIMISSION_TIME IS NULL OR l.DIMISSION_TIME = ''
l.dismissdate IS NULL OR l.dismissdate = ''
)
)AS t
LEFT JOIN hrsa_social_archives social ON t.employeeId = social.employee_id AND social.delete_type = 0

View File

@ -49,10 +49,13 @@
<include refid="baseColumns"/>
FROM hrsa_fund_archives t
WHERE delete_type = 0
AND employee_id IN
<foreach collection="employeeIds" open="(" item="employeeIds" separator="," close=")">
#{employeeIds}
</foreach>
<if test="employeeIds != null and employeeIds.size()>0">
AND employee_id IN
<foreach collection="employeeIds" open="(" item="employeeId" separator="," close=")">
#{employeeId}
</foreach>
</if>
</select>
<!-- 批量删除 -->
@ -60,10 +63,13 @@
UPDATE hrsa_fund_archives
SET delete_type = 1
WHERE delete_type = 0
AND employee_id IN
<foreach collection="employeeIds" open="(" item="employeeIds" separator="," close=")">
#{employeeIds}
</foreach>
<if test="employeeIds != null and employeeIds.size()>0">
AND employee_id IN
<foreach collection="employeeIds" open="(" item="employeeId" separator="," close=")">
#{employeeId}
</foreach>
</if>
</delete>
<!-- 批量保存 -->

View File

@ -45,10 +45,13 @@
<include refid="baseColumns"/>
FROM hrsa_other_archives t
WHERE delete_type = 0
AND employee_id IN
<foreach collection="employeeIds" open="(" item="employeeIds" separator="," close=")">
#{employeeIds}
</foreach>
<if test="employeeIds != null and employeeIds.size()>0">
AND employee_id IN
<foreach collection="employeeIds" open="(" item="employeeId" separator="," close=")">
#{employeeId}
</foreach>
</if>
</select>
@ -58,9 +61,12 @@
SET delete_type = 1
WHERE delete_type = 0
AND employee_id IN
<foreach collection="employeeIds" open="(" item="employeeIds" separator="," close=")">
#{employeeIds}
</foreach>
<if test="employeeIds != null and employeeIds.size()>0">
<foreach collection="employeeIds" open="(" item="employeeId" separator="," close=")">
#{employeeId}
</foreach>
</if>
</delete>
<!-- 批量保存 -->

View File

@ -36,7 +36,7 @@ public interface SocialSchemeMapper {
void batchSave(@Param("socialSchemePOS") List<InsuranceArchivesSocialSchemePO> singletonList);
/**
*
* 人员档案信息
* @param param
* @return
*/
@ -47,4 +47,8 @@ public interface SocialSchemeMapper {
* @return
*/
List<Long> tips();
List<InsuranceArchivesEmployeePO> queryEmployeeList(@Param("param") InsuranceArchivesListParam param);
}

View File

@ -47,10 +47,12 @@
<include refid="baseColumns"/>
FROM hrsa_social_archives t
WHERE delete_type = 0
AND employee_id IN
<foreach collection="employeeIds" open="(" item="employeeIds" separator="," close=")">
#{employeeIds}
</foreach>
<if test="employeeIds != null and employeeIds.size()>0">
AND employee_id IN
<foreach collection="employeeIds" open="(" item="employeeId" separator="," close=")">
#{employeeId}
</foreach>
</if>
</select>
<!-- 批量删除 -->
@ -58,10 +60,12 @@
UPDATE hrsa_social_archives
SET delete_type = 1
WHERE delete_type = 0
AND employee_id IN
<foreach collection="employeeIds" open="(" item="employeeIds" separator="," close=")">
#{employeeIds}
</foreach>
<if test="employeeIds != null and employeeIds.size()>0">
AND employee_id IN
<foreach collection="employeeIds" open="(" item="employeeId" separator="," close=")">
#{employeeId}
</foreach>
</if>
</delete>
<!-- 批量保存 -->
@ -285,4 +289,146 @@
social_start_time is not null and social_end_time is null
</select>
<select id="queryEmployeeList" resultType="com.engine.salary.entity.siarchives.po.InsuranceArchivesEmployeePO">
<!-- <![CDATA[-->
SELECT
a.employeeId,
a.userName,
a.departmentId,
a.jobNum,
a.telephone,
a.departmentName,
a.position,
a.userStatus,
a.hiredate,
l.dimissionDate,
social.siSchemeId,
fund.fundSchemeId,
other.otherSchemeId
FROM
(
SELECT
e.lastname AS userName,
e.jobtitle AS jobNum,
e.departmentid AS departmentId,
d.departmentname AS departmentName,
e.`STATUS` AS userStatus,
e.jobtitle AS position,
e.companystartdate AS hiredate,
e.ID AS employeeId,
e.MOBILE AS telephone
FROM
hrmresource e
LEFT JOIN hrmdepartment d ON e.departmentid = d.ID
)a
LEFT JOIN(
SELECT
t.*
FROM
(
SELECT
log.resource_n,
log.dismissdate AS dimissionDate
FROM
bill_hrmdismiss log
ORDER BY
log.dismissdate DESC
)t
GROUP BY
t.resource_n
)l ON a.employeeId = l.resource_n
LEFT JOIN(
SELECT
social.employee_id,
social.social_scheme_id AS siSchemeId
FROM
hrsa_social_archives social
WHERE social.delete_type = 0
)social ON a.employeeId = social.employee_id
LEFT JOIN(
SELECT
fund.employee_id,
fund.fund_scheme_id AS fundSchemeId
FROM
hrsa_fund_archives fund
WHERE fund.delete_type = 0
)fund ON a.employeeId = fund.employee_id
LEFT JOIN(
SELECT
other.employee_id,
other.other_scheme_id AS otherSchemeId
FROM
hrsa_other_archives other
WHERE other.delete_type = 0
)other ON a.employeeId = other.employee_id
WHERE
1=1
<include refid="condition"></include>
<if test="param.startNum != null and param.pageSize != null">
limit #{param.startNum},#{param.pageSize}
</if>
</select>
<!--]]>-->
<sql id="condition">
<if test="param.keyword != null and param.keyword != ''">
AND
(
userName like CONCAT('%',#{param.keyword},'%')
OR jobNum = #{param.keyword}
)
</if>
<if test="param.userName != null and param.userName != ''">
AND userName like CONCAT('%',#{param.userName},'%')
</if>
<if test="param.jobNum != null and param.jobNum != ''">
AND jobNum = #{param.jobNum}
</if>
<if test="param.departmentIds != null and param.departmentIds.size()>0">
AND 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 userStatus IN
<foreach collection="param.statuses" open="(" item="userStatus" separator="," close=")">
#{userStatus}
</foreach>
</if>
<if test="param.positions != null and param.positions.size()>0">
AND position IN
<foreach collection="param.positions" open="(" item="position" separator="," close=")">
#{position}
</foreach>
</if>
<if test="param.hiredateStart != null">
AND hiredate &gt; #{param.hiredateStart}
</if>
<if test="param.hiredateEnd != null">
AND hiredate &lt; #{param.hiredateEnd}
</if>
<if test="param.dimissionDateStart != null">
AND dimissionDate &gt; #{param.dimissionDateStart}
</if>
<if test="param.dimissionDateEnd != null">
AND dimissionDate &lt; #{param.dimissionDateEnd}
</if>
<if test="param.siSchemeId != null and param.siSchemeId != 0">
AND siSchemeId = #{param.siSchemeId}
</if>
<if test="param.fundSchemeId != null and param.fundSchemeId != 0">
AND fundSchemeId = #{param.fundSchemeId}
</if>
<if test="param.otherSchemeId != null and param.otherSchemeId != 0">
AND otherSchemeId = #{param.otherSchemeId}
</if>
<if test="param.employeeIds != null and param.employeeIds.size() > 0">
AND employeeId IN
<foreach collection="param.employeeIds" open="(" separator="," item="item" close=")">
#{item}
</foreach>
</if>
</sql>
</mapper>

View File

@ -2,7 +2,10 @@ package com.engine.salary.service;
import com.engine.salary.entity.siarchives.param.InsuranceArchivesListParam;
import com.engine.salary.entity.siarchives.param.InsuranceArchivesSaveParam;
import com.engine.salary.entity.siarchives.po.InsuranceArchivesEmployeePO;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import java.util.List;
import java.util.Map;
/**
@ -24,4 +27,25 @@ public interface SIArchivesService {
Map<String, Object> listPage(InsuranceArchivesListParam insuranceArchivesListParam);
Map<String,Object> getSearchCondition(Map<String, Object> stringObjectMap);
/**
* 根据高级搜索框或者员工id集合导出档案
*
* @param param 请求报文
* @return map
*/
XSSFWorkbook export(InsuranceArchivesListParam param);
/**
* 获取员工的基本信息
* <p>
* 此处主要是一个公共接口有多处引用我们薪资系统只保存员工idemployeeId
* 但是页面上需要展示员工的更多信息姓名部门状态
* 所以这里主要是用于接收联表数据的一个接口
*
* @param param 高级搜索条件用于过滤数据
* @return list
*/
List<InsuranceArchivesEmployeePO> listPageEmployeePOS(InsuranceArchivesListParam param);
}

View File

@ -11,8 +11,6 @@ import com.engine.salary.biz.SIAccountBiz;
import com.engine.salary.biz.SIArchivesBiz;
import com.engine.salary.component.SalaryWeaTable;
import com.engine.salary.constant.SalaryDefaultTenantConstant;
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
import com.engine.salary.entity.salaryarchive.dto.SalaryArchiveListDTO;
import com.engine.salary.entity.siaccount.bo.InsuranceAccountBO;
import com.engine.salary.entity.siaccount.dto.InsuranceAccountBatchListDTO;
import com.engine.salary.entity.siaccount.dto.InsuranceAccountTabDTO;
@ -162,6 +160,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
List<WeaTableColumn> weaTableColumn = getColumnBuildService(user).buildCommonColumnsWithStyle(insuranceAccountDetailPOS, employeeId, SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY, false);
WeaTable table = new WeaTable();
table.setPageUID(UUID.randomUUID().toString());
table.setColumns(weaTableColumn);
List<Column> columns = weaTableColumn.stream().map(v -> new Column(v.getText(), v.getColumn(), v.getColumn())).collect(Collectors.toList());
pageInfos.setColumns(columns);
@ -172,7 +171,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
result.success();
datas.put("pageInfo", pageInfos);
datas.put("dataKey",result.getResultMap());
//datas.put("dataKey",result.getResultMap());
return datas;
}
@ -183,9 +182,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
public Map<String, Object> listCommonPageByName(InsuranceAccountDetailParam queryParam) {
//增加查询参数userName
if (StringUtils.isNotBlank(queryParam.getUserName())) {
List<DataCollectionEmployee> employeeIdsByUserName = MapperProxyFactory.getProxy(EmployMapper.class).getEmployeeIdsByUserName(queryParam.getUserName());
List<Long> employeeIds = employeeIdsByUserName.stream().map(DataCollectionEmployee::getEmployeeId).collect(Collectors.toList());
queryParam.setEmployeeIds(employeeIds);
queryParam.setUserName(queryParam.getUserName());
}
return listCommonPage(queryParam);
}
@ -215,6 +212,8 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
SalaryWeaTable<InsuranceAccountDetailPO> table = new SalaryWeaTable<>(user, InsuranceAccountDetailPO.class);
table.setColumns(weaTableColumn);
List<Column> columns = weaTableColumn.stream().map(v -> new Column(v.getText(), v.getColumn(), v.getColumn())).collect(Collectors.toList());
pageInfos.setColumns(columns);
WeaResultMsg result = new WeaResultMsg(false);
@ -222,7 +221,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
result.success();
datas.put("pageInfo", pageInfos);
datas.put("dataKey",result.getResultMap());
//datas.put("dataKey",result.getResultMap());
return datas;
}
@ -232,9 +231,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
public Map<String, Object> supplementaryByNameList(InsuranceAccountDetailParam queryParam) {
//增加查询参数userName
if (StringUtils.isNotBlank(queryParam.getUserName())) {
List<DataCollectionEmployee> employeeIdsByUserName = MapperProxyFactory.getProxy(EmployMapper.class).getEmployeeIdsByUserName(queryParam.getUserName());
List<Long> employeeIds = employeeIdsByUserName.stream().map(DataCollectionEmployee::getEmployeeId).collect(Collectors.toList());
queryParam.setEmployeeIds(employeeIds);
queryParam.setUserName(queryParam.getUserName());
}
return listSupplementaryPage(queryParam);
}
@ -570,8 +567,6 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
@Override
public PageInfo<InsuranceAccountViewListDTO> overView(InsuranceAccountDetailParam queryParam) {
PageInfo<InsuranceAccountViewListDTO> pageInfos = siAccountBiz.overView(queryParam);
pageInfos.setPageNum(queryParam.getCurrent());
pageInfos.setPageSize(queryParam.getPageSize());
return pageInfos;
}

View File

@ -1,16 +1,22 @@
package com.engine.salary.service.impl;
import com.cloudstore.eccom.pc.table.WeaTableColumn;
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.entity.siarchives.po.InsuranceArchivesEmployeePO;
import com.engine.salary.enums.sicategory.WelfareTypeEnum;
import com.engine.salary.mapper.siarchives.SocialSchemeMapper;
import com.engine.salary.service.SIArchivesService;
import com.engine.salary.util.SalaryI18nUtil;
import com.engine.salary.util.db.MapperProxyFactory;
import com.engine.salary.util.excel.ExcelUtil;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import weaver.general.Util;
import java.util.HashMap;
import java.util.Map;
import java.util.*;
/**
* @Author weaver_cl
@ -20,6 +26,8 @@ import java.util.Map;
**/
public class SIArchivesServiceImpl extends Service implements SIArchivesService {
private SIArchivesBiz siArchivesBiz = new SIArchivesBiz();
@Override
public Map<String, Object> getTips(Map<String, Object> params) {
return commandExecutor.execute(new SIArchivesTipsCmd(params,user));
@ -70,5 +78,57 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService
return apidatas;
}
@Override
public XSSFWorkbook export(InsuranceArchivesListParam param) {
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]);
}
if (Objects.equals("fromQuickSearch", param.getDataSource())) {
request.setStatuses(param.getStatuses());
request.setKeyword(param.getUserName());
} else {
request = param;
}
request.setPageSize(null);
request.setStartNum(null);
List<InsuranceArchivesEmployeePO> insuranceArchivesEmployeePOS = listPageEmployeePOS(request);
if (insuranceArchivesEmployeePOS == null) {
insuranceArchivesEmployeePOS = new ArrayList<>();
}
List<Map<String, Object>> records = siArchivesBiz.buildTableData(insuranceArchivesEmployeePOS);
List<WeaTableColumn> columns = siArchivesBiz.buildWeaTableColumns(insuranceArchivesEmployeePOS,user.getUID());
//工作簿list
List<List<Object>> excelSheetData = new ArrayList<>();
//工作簿名称
String sheetName = SalaryI18nUtil.getI18nLabel(85368, "社保福利档案"); //表头
//表头
excelSheetData.add(Collections.singletonList(columns.stream().map(WeaTableColumn::getText).toArray(String[]::new)));
//工作簿数据
List<List<Object>> rows = new LinkedList<>();
for (Map<String, Object> recordData : records) {
List<Object> row = new LinkedList<>();
for (WeaTableColumn column : columns) {
row.add(recordData.get(column.getColumn()));
}
rows.add(row);
}
excelSheetData.addAll(rows);
return ExcelUtil.genWorkbookV2(excelSheetData, sheetName);
}
@Override
public List<InsuranceArchivesEmployeePO> listPageEmployeePOS(InsuranceArchivesListParam param) {
return MapperProxyFactory.getProxy(SocialSchemeMapper.class).listPageEmployeePOS(param);
}
}

View File

@ -112,7 +112,7 @@ public class SIExportServiceImpl extends Service implements SIExportService {
List<List<Object>> excelSheetData = new ArrayList<>();
//工作簿名称
String sheetName = SalaryI18nUtil.getI18nLabel(85368, "社保福利档案"); //表头
excelSheetData.add(Collections.singletonList(columns.stream().map(item -> item.getText()).toArray(String[]::new)));
excelSheetData.add(Collections.singletonList(columns.stream().map(WeaTableColumn::getText).toArray(String[]::new)));
//工作簿数据
List<List<Object>> rows = new LinkedList<>();
for (Map<String, Object> recordData : records) {

View File

@ -1,6 +1,10 @@
package com.engine.salary.web;
import com.engine.common.util.ServiceUtil;
import com.engine.salary.biz.SIAccountBiz;
import com.engine.salary.entity.siaccount.param.InspectAccountParam;
import com.engine.salary.entity.siaccount.po.InsuranceAccountInspectPO;
import com.engine.salary.entity.siarchives.param.InsuranceArchivesListParam;
import com.engine.salary.entity.siexport.param.InsuranceExportParam;
import com.engine.salary.enums.siaccount.PaymentStatusEnum;
import com.engine.salary.service.SIAccountService;
@ -23,6 +27,8 @@ import javax.ws.rs.core.StreamingOutput;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.time.LocalDate;
import java.util.List;
import java.util.stream.Collectors;
/**
* @Author weaver_cl
@ -40,6 +46,56 @@ public class SIExportController {
return ServiceUtil.getService(SIExportWrapper.class,user);
}
@POST
@Path("/archives/export")
@Produces(MediaType.APPLICATION_OCTET_STREAM)
public Response export(@Context HttpServletRequest request, @Context HttpServletResponse response,
@RequestBody InsuranceArchivesListParam param) {
User user = HrmUserVarify.getUser(request, response);
XSSFWorkbook workbook = getSIExportWrapper(user).export(param);
String time = LocalDate.now().toString();
String fileName = "福利档案报表" + time;
try {
fileName = URLEncoder.encode(fileName + ".xlsx", "UTF-8");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
StreamingOutput output = outputStream -> {
workbook.write(outputStream);
outputStream.flush();
};
response.setContentType("application/octet-stream");
return Response.ok(output).header("Content-disposition", "attachment;filename=" + fileName).header("Cache-Control", "no-cache").build();
}
@POST
@Path("/archives/exportInspect")
@Produces(MediaType.APPLICATION_OCTET_STREAM)
public Response exportInspect(@Context HttpServletRequest request, @Context HttpServletResponse response,
@RequestBody InspectAccountParam param) {
User user = HrmUserVarify.getUser(request, response);
SIAccountBiz siAccountBiz = new SIAccountBiz();
List<InsuranceAccountInspectPO> insuranceAccountInspectPOS = siAccountBiz.allInspects(param.getIds(), param.getBillMonth());
InsuranceArchivesListParam req = new InsuranceArchivesListParam();
req.setEmployeeIds(insuranceAccountInspectPOS.stream().map(InsuranceAccountInspectPO::getEmployeeId).distinct().collect(Collectors.toList()));
XSSFWorkbook workbook = getSIExportWrapper(user).export(req);
String time = LocalDate.now().toString();
String fileName = "核算异常人员档案报表" + time;
try {
fileName = URLEncoder.encode(fileName + ".xlsx", "UTF-8");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
StreamingOutput output = outputStream -> {
workbook.write(outputStream);
outputStream.flush();
};
response.setContentType("application/octet-stream");
return Response.ok(output).header("Content-disposition", "attachment;filename=" + fileName).header("Cache-Control", "no-cache").build();
}
@POST
@Path("/common/export")

View File

@ -2,8 +2,11 @@ package com.engine.salary.wrapper;
import com.engine.common.util.ServiceUtil;
import com.engine.core.impl.Service;
import com.engine.salary.entity.siarchives.param.InsuranceArchivesListParam;
import com.engine.salary.entity.siexport.param.InsuranceExportParam;
import com.engine.salary.service.SIArchivesService;
import com.engine.salary.service.SIExportService;
import com.engine.salary.service.impl.SIArchivesServiceImpl;
import com.engine.salary.service.impl.SIExportServiceImpl;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import weaver.hrm.User;
@ -20,6 +23,10 @@ public class SIExportWrapper extends Service {
return ServiceUtil.getService(SIExportServiceImpl.class, user);
}
public SIArchivesService getSIArchivesService(User user) {
return ServiceUtil.getService(SIArchivesServiceImpl.class, user);
}
public XSSFWorkbook exportOverView(InsuranceExportParam param) {
return getSIExportService(user).exportOverView(param);
@ -28,4 +35,10 @@ public class SIExportWrapper extends Service {
public XSSFWorkbook exportAccount(Integer paymentStatus, InsuranceExportParam param) {
return getSIExportService(user).exportAccount(paymentStatus,param);
}
public XSSFWorkbook export(InsuranceArchivesListParam param) {
return getSIArchivesService(user).export(param);
}
}