我的薪资福利

This commit is contained in:
钱涛 2022-04-22 19:22:40 +08:00
parent 16a4f32ec1
commit 3b342d4ec7
9 changed files with 355 additions and 7 deletions

View File

@ -46,16 +46,31 @@ ALTER TABLE hrsa_salary_item
CREATE TABLE hrsa_salary_sob_item
(
id bigint(20) identity (1,1) PRIMARY KEY,
salary_sob_id bigint(20) NOT NULL,
salary_item_id bigint(20) NOT NULL,
salary_sob_item_group_id bigint(20) NOT NULL,
formula_id bigint(20) NOT NULL,
id bigint identity (1,1) PRIMARY KEY,
salary_sob_id bigint NOT NULL,
salary_item_id bigint NOT NULL,
salary_sob_item_group_id bigint NOT NULL,
formula_id bigint NOT NULL,
sorted_index int(11) NOT NULL,
description varchar(1000) NOT NULL DEFAULT '',
create_time datetime NOT NULL,
update_time datetime NOT NULL,
creator bigint(20) NOT NULL,
creator bigint NOT NULL,
delete_type int(11) NOT NULL,
tenant_key varchar(10) NOT NULL
);
);
CREATE TABLE hrsa_sob_default_item_group
(
id bigint identity (1,1) PRIMARY KEY,
income_category tinyint NOT NULL DEFAULT '1' ,
name varchar(100) NOT NULL DEFAULT '' ,
sorted_index int NOT NULL DEFAULT '0',
description varchar(1000) NOT NULL DEFAULT '' ,
create_time datetime NOT NULL ,
update_time datetime NOT NULL ,
creator bigint NOT NULL DEFAULT '0',
delete_type int NOT NULL DEFAULT '0' ,
tenant_key varchar(10) NOT NULL DEFAULT ''
) ;

View File

@ -0,0 +1,16 @@
package com.api.salary.web;
import javax.ws.rs.Path;
/**
* 福利报表
* <p>Copyright: Copyright (c) 2022</p>
* <p>Company: 泛微软件</p>
*
* @author qiantao
* @version 1.0
**/
@Path("/bs/hrmsalary/report")
public class SIReportController extends com.engine.salary.web.SIReportController {
}

View File

@ -0,0 +1,25 @@
package com.engine.salary.entity.siaccount.param;
import com.engine.salary.common.BaseQueryParam;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* 查询福利报表
* <p>Copyright: Copyright (c) 2022</p>
* <p>Company: 泛微软件</p>
*
* @author qiantao
* @version 1.0
**/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class QueryAccountDetailParam extends BaseQueryParam {
String startMonth;
String endMonth;
Long employeeId;
}

View File

@ -0,0 +1,17 @@
package com.engine.salary.mapper.siaccount;
import com.engine.salary.entity.siaccount.param.QueryAccountDetailParam;
import com.engine.salary.entity.siaccount.po.InsuranceAccountDetailPO;
import java.util.List;
public interface SIAccountDetailMapper {
/**
* 条件查询
*
* @return 返回集合没有返回空List
*/
List<InsuranceAccountDetailPO> listSome(QueryAccountDetailParam param);
}

View File

@ -0,0 +1,116 @@
<?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.siaccount.SIAccountDetailMapper">
<resultMap id="BaseResultMap" type="com.engine.salary.entity.siaccount.po.InsuranceAccountDetailPO">
<result column="id" property="id" />
<result column="employee_id" property="employeeId" />
<result column="bill_month" property="billMonth" />
<result column="bill_status" property="billStatus" />
<result column="payment_status" property="paymentStatus" />
<result column="supplementary_month" property="supplementaryMonth" />
<result column="supplementary_projects" property="supplementaryProjects" />
<result column="resource_from" property="resourceFrom" />
<result column="social_pay_org" property="socialPayOrg" />
<result column="social_account" property="socialAccount" />
<result column="social_scheme_id" property="socialSchemeId" />
<result column="social_payment_base_string" property="socialPaymentBaseString" />
<result column="fund_pay_org" property="fundPayOrg" />
<result column="fund_account" property="fundAccount" />
<result column="supplement_fund_account" property="supplementFundAccount" />
<result column="fund_scheme_id" property="fundSchemeId" />
<result column="fund_payment_base_string" property="fundPaymentBaseString" />
<result column="other_pay_org" property="otherPayOrg" />
<result column="other_scheme_id" property="otherSchemeId" />
<result column="other_payment_base_string" property="otherPaymentBaseString" />
<result column="social_per_json" property="socialPerJson" />
<result column="social_per_sum" property="socialPerSum" />
<result column="fund_per_json" property="fundPerJson" />
<result column="fund_per_sum" property="fundPerSum" />
<result column="other_per_json" property="otherPerJson" />
<result column="other_per_sum" property="otherPerSum" />
<result column="per_sum" property="perSum" />
<result column="social_com_json" property="socialComJson" />
<result column="social_com_sum" property="socialComSum" />
<result column="fund_com_json" property="fundComJson" />
<result column="fund_com_sum" property="fundComSum" />
<result column="other_com_json" property="otherComJson" />
<result column="other_com_sum" property="otherComSum" />
<result column="com_sum" property="comSum" />
<result column="social_sum" property="socialSum" />
<result column="fund_sum" property="fundSum" />
<result column="other_sum" property="otherSum" />
<result column="total" property="total" />
<result column="creator" property="creator" />
<result column="create_time" property="createTime" />
<result column="update_time" property="updateTime" />
<result column="delete_type" property="deleteType" />
<result column="tenant_key" property="tenantKey" />
</resultMap>
<!-- 表字段 -->
<sql id="baseColumns">
t.id
, t.employee_id
, t.bill_month
, t.bill_status
, t.payment_status
, t.supplementary_month
, t.supplementary_projects
, t.resource_from
, t.social_pay_org
, t.social_account
, t.social_scheme_id
, t.social_payment_base_string
, t.fund_pay_org
, t.fund_account
, t.supplement_fund_account
, t.fund_scheme_id
, t.fund_payment_base_string
, t.other_pay_org
, t.other_scheme_id
, t.other_payment_base_string
, t.social_per_json
, t.social_per_sum
, t.fund_per_json
, t.fund_per_sum
, t.other_per_json
, t.other_per_sum
, t.per_sum
, t.social_com_json
, t.social_com_sum
, t.fund_com_json
, t.fund_com_sum
, t.other_com_json
, t.other_com_sum
, t.com_sum
, t.social_sum
, t.fund_sum
, t.other_sum
, t.total
, t.creator
, t.create_time
, t.update_time
, t.delete_type
, t.tenant_key
</sql>
<!-- 条件查询 -->
<select id="listSome" resultMap="BaseResultMap" parameterType="com.engine.salary.entity.siaccount.param.QueryAccountDetailParam">
SELECT
<include refid="baseColumns" />
FROM hrsa_bill_detail t
WHERE delete_type = 0
<if test="employeeId != null">
AND employee_id = #{employeeId}
</if>
<if test="startMonth != null">
AND bill_month >= #{startMonth}
</if>
<if test="billMonth != null">
AND bill_month &gt;= #{endMonth}
</if>
ORDER BY id DESC
</select>
</mapper>

View File

@ -0,0 +1,11 @@
package com.engine.salary.service;
import com.engine.salary.entity.siaccount.param.QueryAccountDetailParam;
import com.engine.salary.entity.siaccount.po.InsuranceAccountDetailPO;
import com.engine.salary.util.page.PageInfo;
public interface SIReportService {
PageInfo<InsuranceAccountDetailPO> welfareList(QueryAccountDetailParam param);
}

View File

@ -0,0 +1,28 @@
package com.engine.salary.service.impl;
import com.engine.core.impl.Service;
import com.engine.salary.entity.siaccount.param.QueryAccountDetailParam;
import com.engine.salary.entity.siaccount.po.InsuranceAccountDetailPO;
import com.engine.salary.mapper.siaccount.SIAccountDetailMapper;
import com.engine.salary.service.SIReportService;
import com.engine.salary.util.db.MapperProxyFactory;
import com.engine.salary.util.page.PageInfo;
import com.engine.salary.util.page.PageUtil;
import java.util.List;
public class SIReportServiceImpl extends Service implements SIReportService {
private SIAccountDetailMapper getSIAccountDetailMapper(){
return MapperProxyFactory.getProxy(SIAccountDetailMapper.class);
}
@Override
public PageInfo<InsuranceAccountDetailPO> welfareList(QueryAccountDetailParam param) {
PageUtil.start(param.getCurrent(),param.getPageSize());
List<InsuranceAccountDetailPO> insuranceAccountDetailPOS = getSIAccountDetailMapper().listSome(param);
PageInfo<InsuranceAccountDetailPO> page = new PageInfo<>(insuranceAccountDetailPOS ,InsuranceAccountDetailPO.class);
return page;
}
}

View File

@ -0,0 +1,51 @@
package com.engine.salary.web;
import com.engine.common.util.ServiceUtil;
import com.engine.salary.entity.siaccount.param.QueryAccountDetailParam;
import com.engine.salary.util.ResponseResult;
import com.engine.salary.wrapper.SIReportWrapper;
import com.engine.salary.wrapper.SalaryArchiveItemWrapper;
import io.swagger.v3.oas.annotations.parameters.RequestBody;
import weaver.hrm.HrmUserVarify;
import weaver.hrm.User;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
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;
import java.util.Map;
/**
* 福利报表
* <p>Copyright: Copyright (c) 2022</p>
* <p>Company: 泛微软件</p>
*
* @author qiantao
* @version 1.0
**/
public class SIReportController {
private SalaryArchiveItemWrapper salaryArchiveItemWrapper;
private SalaryArchiveItemWrapper getSalaryArchiveItemWrapper(User user) {
return (SalaryArchiveItemWrapper) ServiceUtil.getService(SalaryArchiveItemWrapper.class, user);
}
private SIReportWrapper getSIReportWrapper(User user) {
return (SIReportWrapper) ServiceUtil.getService(SIReportWrapper.class, user);
}
@POST
@Path("welfare/list")
@Produces(MediaType.APPLICATION_JSON)
public String list(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody QueryAccountDetailParam queryParam) {
User user = HrmUserVarify.getUser(request, response);
return new ResponseResult<QueryAccountDetailParam, Map<String,Object>>().run(getSIReportWrapper(user)::welfareList, queryParam);
}
}

View File

@ -0,0 +1,69 @@
package com.engine.salary.wrapper;
import com.cloudstore.eccom.pc.table.WeaTable;
import com.cloudstore.eccom.pc.table.WeaTableColumn;
import com.cloudstore.eccom.result.WeaResultMsg;
import com.engine.common.util.ServiceUtil;
import com.engine.core.impl.Service;
import com.engine.salary.entity.siaccount.param.QueryAccountDetailParam;
import com.engine.salary.entity.siaccount.po.InsuranceAccountDetailPO;
import com.engine.salary.service.ColumnBuildService;
import com.engine.salary.service.RecordsBuildService;
import com.engine.salary.service.SIReportService;
import com.engine.salary.service.impl.ColumnBuildServiceImpl;
import com.engine.salary.service.impl.RecordsBuildServiceImpl;
import com.engine.salary.service.impl.SIReportServiceImpl;
import com.engine.salary.util.page.PageInfo;
import weaver.hrm.User;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class SIReportWrapper extends Service {
private SIReportService getSIReportService(User user) {
return (SIReportService) ServiceUtil.getService(SIReportServiceImpl.class, user);
}
private RecordsBuildService getRecordsBuildService(User user) {
return (RecordsBuildService) ServiceUtil.getService(RecordsBuildServiceImpl.class, user);
}
private ColumnBuildService getColumnBuildService(User user) {
return (ColumnBuildService) ServiceUtil.getService(ColumnBuildServiceImpl.class, user);
}
public Map<String,Object> welfareList(QueryAccountDetailParam param) {
PageInfo<InsuranceAccountDetailPO> page = getSIReportService(user).welfareList(param);
List<InsuranceAccountDetailPO> list = page.getList();
List<Map<String, Object>> records = getRecordsBuildService(user).buildCommonRecordsWithStyle(list, param.getEmployeeId());
PageInfo<Map<String, Object>> pageInfo = new PageInfo<>(records);
pageInfo.setTotal(page.getTotal());
pageInfo.setPageNum(page.getPageNum());
pageInfo.setPageSize(page.getPageSize());
List<WeaTableColumn> columns = getColumnBuildService(user).buildCommonColumns(list);
WeaTable table = new WeaTable();
table.setColumns(columns);
WeaResultMsg result = new WeaResultMsg(false);
result.putAll(table.makeDataResult());
result.success();
Map<String,Object> datas = new HashMap<>();
datas.put("pageInfo", pageInfo);
datas.put("dataKey",result.getResultMap());
return datas;
}
}