This commit is contained in:
钱涛 2022-09-27 10:19:09 +08:00
parent 6e726366ad
commit e2db30c816
8 changed files with 126 additions and 34 deletions

View File

@ -39,6 +39,9 @@ import com.engine.salary.service.SalaryEmployeeService;
import com.engine.salary.service.TaxAgentService;
import com.engine.salary.service.impl.SalaryEmployeeServiceImpl;
import com.engine.salary.service.impl.TaxAgentServiceImpl;
import com.engine.salary.sys.entity.vo.OrderRuleVO;
import com.engine.salary.sys.service.SalarySysConfService;
import com.engine.salary.sys.service.impl.SalarySysConfServiceImpl;
import com.engine.salary.util.SalaryAssert;
import com.engine.salary.util.SalaryDateUtil;
import com.engine.salary.util.SalaryEntityUtil;
@ -54,6 +57,7 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import weaver.hrm.User;
import java.math.BigDecimal;
import java.util.*;
@ -99,6 +103,10 @@ public class SIAccountBiz extends Service {
return MapperProxyFactory.getProxy(InsuranceAccountInspectMapper.class);
}
private SalarySysConfService getSalarySysConfService(User user) {
return ServiceUtil.getService(SalarySysConfServiceImpl.class, user);
}
public PageInfo<InsuranceAccountBatchPO> listPage(InsuranceAccountBatchParam queryParam) {
SalaryPageUtil.start(queryParam.getCurrent(), queryParam.getPageSize());
List<InsuranceAccountBatchPO> list = getInsuranceAccountBatchMapper().list(queryParam);
@ -109,6 +117,11 @@ public class SIAccountBiz extends Service {
public PageInfo<InsuranceAccountDetailPO> listCommonPage(InsuranceAccountDetailParam queryParam) {
queryParam.setPaymentStatus(PaymentStatusEnum.COMMON.getValue());
//排序配置
OrderRuleVO orderRule = getSalarySysConfService(user).orderRule();
queryParam.setOrderRule(orderRule);
SalaryPageUtil.start(queryParam.getCurrent(), queryParam.getPageSize());
List<InsuranceAccountDetailPO> list = getInsuranceAccountDetailMapper().list(queryParam);
InsuranceAccountDetailPOEncrypt.decryptInsuranceAccountDetailPOList(list);

View File

@ -1,5 +1,6 @@
package com.engine.salary.entity.siexport.param;
import com.engine.salary.common.BaseQueryParam;
import com.engine.salary.util.valid.DataCheck;
import lombok.AllArgsConstructor;
import lombok.Builder;
@ -17,7 +18,7 @@ import lombok.NoArgsConstructor;
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class InsuranceExportParam {
public class InsuranceExportParam extends BaseQueryParam {
//@NotBlank
@DataCheck(require = true,message = "账单月份不可为空")

View File

@ -1,5 +1,6 @@
package com.engine.salary.mapper;
import com.engine.salary.entity.siexport.param.InsuranceExportParam;
import com.engine.salary.entity.siexport.po.AccountExportPO;
import org.apache.ibatis.annotations.Param;
@ -13,6 +14,6 @@ import java.util.List;
**/
public interface InsuranceExportMapper {
List<AccountExportPO> exportAccount(@Param("paymentStatus") Integer paymentStatus, @Param("billMonth") String billMonth,@Param("paymentOrganization") String paymentOrganization);
List<AccountExportPO> exportAccount(@Param("paymentStatus") Integer paymentStatus, @Param("param") InsuranceExportParam param);
}

View File

@ -2,37 +2,75 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.engine.salary.mapper.InsuranceExportMapper">
<select id="exportAccount" resultType="com.engine.salary.entity.siexport.po.AccountExportPO">
SELECT
a.*,e.lastname AS userName,e.MOBILE AS telephone,d.departmentname AS departmentName,e.STATUS AS userStatus
FROM(
SELECT * from hrsa_bill_detail
WHERE delete_type = 0 AND bill_month = #{billMonth} AND payment_status = #{paymentStatus} AND payment_organization = #{paymentOrganization}
)a
LEFT JOIN hrmresource e ON e.ID = a.employee_id
LEFT JOIN hrmdepartment d ON d.id = e.departmentid
where e.status not in (7)
SELECT a.*,
e.lastname AS userName,
e.MOBILE AS telephone,
d.departmentname AS departmentName,
e.STATUS AS userStatus
FROM (
SELECT *
from hrsa_bill_detail
WHERE delete_type = 0
AND bill_month = #{param.billMonth}
AND payment_status = #{paymentStatus}
AND payment_organization = #{param.paymentOrganization}
) a
LEFT JOIN hrmresource e ON e.ID = a.employee_id
LEFT JOIN hrmdepartment d ON d.id = e.departmentid
LEFT JOIN hrmsubcompany c ON c.id = e.subcompanyid1
where e.status not in (7)
and (e.accounttype is null or e.accounttype = 0)
<!-- 排序 -->
<if test="param.orderRule != null">
ORDER BY ${param.orderRule.orderRule} ${param.orderRule.ascOrDesc}
</if>
</select>
<select id="exportAccount" resultType="com.engine.salary.entity.siexport.po.AccountExportPO" databaseId="oracle">
SELECT
a.*,e.lastname AS userName,e.MOBILE AS telephone,d.departmentname AS departmentName,e.STATUS AS userStatus
FROM(
SELECT * from hrsa_bill_detail
WHERE delete_type = 0 AND bill_month = #{billMonth} AND payment_status = #{paymentStatus} AND payment_organization = #{paymentOrganization}
)a
LEFT JOIN hrmresource e ON e.ID = a.employee_id
LEFT JOIN hrmdepartment d ON d.id = e.departmentid
where e.status not in (7)
SELECT a.*,
e.lastname AS userName,
e.MOBILE AS telephone,
d.departmentname AS departmentName,
e.STATUS AS userStatus
FROM (
SELECT *
from hrsa_bill_detail
WHERE delete_type = 0
AND bill_month = #{param.billMonth}
AND payment_status = #{paymentStatus}
AND payment_organization = #{param.paymentOrganization}
) a
LEFT JOIN hrmresource e ON e.ID = a.employee_id
LEFT JOIN hrmdepartment d ON d.id = e.departmentid
LEFT JOIN hrmsubcompany c ON c.id = e.subcompanyid1
where e.status not in (7)
and (e.accounttype is null or e.accounttype = 0)
</select>
<!-- 排序 -->
<if test="param.orderRule != null">
ORDER BY ${param.orderRule.orderRule} ${param.orderRule.ascOrDesc}
</if>
</select>
<select id="exportAccount" resultType="com.engine.salary.entity.siexport.po.AccountExportPO" databaseId="sqlserver">
SELECT
a.*,e.lastname AS userName,e.MOBILE AS telephone,d.departmentname AS departmentName,e.STATUS AS userStatus
FROM(
SELECT * from hrsa_bill_detail
WHERE delete_type = 0 AND bill_month = #{billMonth} AND payment_status = #{paymentStatus} AND payment_organization = #{paymentOrganization}
)a
LEFT JOIN hrmresource e ON e.ID = a.employee_id
LEFT JOIN hrmdepartment d ON d.id = e.departmentid
</select>
SELECT a.*,
e.lastname AS userName,
e.MOBILE AS telephone,
d.departmentname AS departmentName,
e.STATUS AS userStatus
FROM (
SELECT *
from hrsa_bill_detail
WHERE delete_type = 0
AND bill_month = #{param.billMonth}
AND payment_status = #{paymentStatus}
AND payment_organization = #{param.paymentOrganization}
) a
LEFT JOIN hrmresource e ON e.ID = a.employee_id
LEFT JOIN hrmdepartment d ON d.id = e.departmentid
LEFT JOIN hrmsubcompany c ON c.id = e.subcompanyid1
where e.status not in (7)
and (e.accounttype is null or e.accounttype = 0)
<!-- 排序 -->
<if test="param.orderRule != null">
ORDER BY ${param.orderRule.orderRule} ${param.orderRule.ascOrDesc}
</if>
</select>
</mapper>

View File

@ -146,13 +146,18 @@
FROM
hrsa_bill_detail t
left join hrmresource e
LEFT JOIN hrmdepartment d ON d.id = e.departmentid
LEFT JOIN hrmsubcompany c ON c.id = e.subcompanyid1
on e.ID = t.employee_id
WHERE t.delete_type = 0
and e.status not in (7)
and (e.accounttype is null or e.accounttype = 0)
<include refid="paramSqlCommon"/>
<include refid="paramSql"/>
ORDER BY t.update_time DESC
<!-- 排序 -->
<if test="param.orderRule != null">
ORDER BY ${param.orderRule.orderRule} ${param.orderRule.ascOrDesc}
</if>
</select>
<select id="selectList" resultMap="BaseResultMap">

View File

@ -41,6 +41,9 @@ import com.engine.salary.mapper.sys.SalarySysConfMapper;
import com.engine.salary.mapper.taxagent.TaxAgentMapper;
import com.engine.salary.service.*;
import com.engine.salary.sys.entity.po.SalarySysConfPO;
import com.engine.salary.sys.entity.vo.OrderRuleVO;
import com.engine.salary.sys.service.SalarySysConfService;
import com.engine.salary.sys.service.impl.SalarySysConfServiceImpl;
import com.engine.salary.util.SalaryDateUtil;
import com.engine.salary.util.SalaryFormItemUtil;
import com.engine.salary.util.SalaryI18nUtil;
@ -131,6 +134,10 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user);
}
private SalarySysConfService getSalarySysConfService(User user) {
return ServiceUtil.getService(SalarySysConfServiceImpl.class, user);
}
private EmployBiz employeeBiz = new EmployBiz();
private TaxAgentBiz taxAgentBiz = new TaxAgentBiz();
@ -270,6 +277,11 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
//补缴缴纳列表
queryParam.setPaymentStatus(PaymentStatusEnum.REPAIR.getValue());
//排序配置
OrderRuleVO orderRule = getSalarySysConfService(user).orderRule();
queryParam.setOrderRule(orderRule);
SalaryPageUtil.start(queryParam.getCurrent(), queryParam.getPageSize());
List<InsuranceAccountDetailPO> list = getInsuranceAccountDetailMapper().list(queryParam);
PageInfo<InsuranceAccountDetailPO> pageInfo = new PageInfo<>(list, InsuranceAccountDetailPO.class);

View File

@ -24,6 +24,9 @@ import com.engine.salary.mapper.sicategory.ICategoryMapper;
import com.engine.salary.mapper.taxagent.TaxAgentMapper;
import com.engine.salary.service.SIExportService;
import com.engine.salary.service.SISchemeService;
import com.engine.salary.sys.entity.vo.OrderRuleVO;
import com.engine.salary.sys.service.SalarySysConfService;
import com.engine.salary.sys.service.impl.SalarySysConfServiceImpl;
import com.engine.salary.util.SalaryAssert;
import com.engine.salary.util.SalaryEnumUtil;
import com.engine.salary.util.SalaryI18nUtil;
@ -69,6 +72,10 @@ public class SIExportServiceImpl extends Service implements SIExportService {
return MapperProxyFactory.getProxy(InsuranceExportMapper.class);
}
private SalarySysConfService getSalarySysConfService(User user) {
return ServiceUtil.getService(SalarySysConfServiceImpl.class, user);
}
@Override
public XSSFWorkbook exportOverView(InsuranceExportParam queryParam) {
List<InsuranceAccountDetailPO> insuranceAccountDetailPOS = getInsuranceAccountDetailMapper().selectList(queryParam.getBillMonth(), StringUtils.isBlank(queryParam.getPaymentOrganization()) ? null : Long.valueOf(queryParam.getPaymentOrganization()));
@ -117,14 +124,19 @@ public class SIExportServiceImpl extends Service implements SIExportService {
@Override
public XSSFWorkbook exportAccount(Integer paymentStatus, InsuranceExportParam param) {
List<AccountExportPO> accountExportPOS = getInsuranceExportMapper().exportAccount(paymentStatus, param.getBillMonth(), param.getPaymentOrganization());
//排序配置
OrderRuleVO orderRule = getSalarySysConfService(user).orderRule();
param.setOrderRule(orderRule);
List<AccountExportPO> accountExportPOS = getInsuranceExportMapper().exportAccount(paymentStatus, param);
AccountExportPOEncrypt.decryptAccountExportPOList(accountExportPOS);
List<WeaTableColumn> columns = new ArrayList<>();
List<Map<String, Object>> records = new ArrayList<>();
if (PaymentStatusEnum.COMMON.getValue() == paymentStatus) {
if (Objects.equals(PaymentStatusEnum.COMMON.getValue(), paymentStatus)) {
columns = buildCommonColumns(accountExportPOS, false);
}
if (PaymentStatusEnum.REPAIR.getValue() == paymentStatus) {
if (Objects.equals(PaymentStatusEnum.REPAIR.getValue(), paymentStatus)) {
columns = buildCommonColumns(accountExportPOS, true);
}
records = buildCommonRecords(accountExportPOS);

View File

@ -39,6 +39,9 @@ import com.engine.salary.mapper.sys.SalarySysConfMapper;
import com.engine.salary.mapper.taxagent.TaxAgentMapper;
import com.engine.salary.service.*;
import com.engine.salary.sys.entity.po.SalarySysConfPO;
import com.engine.salary.sys.entity.vo.OrderRuleVO;
import com.engine.salary.sys.service.SalarySysConfService;
import com.engine.salary.sys.service.impl.SalarySysConfServiceImpl;
import com.engine.salary.util.*;
import com.engine.salary.util.db.MapperProxyFactory;
import com.engine.salary.util.excel.ExcelParseHelper;
@ -126,6 +129,9 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
return SqlProxyHandle.getProxy(SalarySysConfMapper.class);
}
private SalarySysConfService getSalarySysConfService(User user) {
return ServiceUtil.getService(SalarySysConfServiceImpl.class, user);
}
@Override
public Map<String, Object> getForm(Map<String, Object> params) {
return commandExecutor.execute(new SISchemeGetFormCmd(params, user));
@ -208,6 +214,10 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
@Override
public List<InsuranceArchivesEmployeePO> listPageEmployeePOS(InsuranceArchivesListParam param) {
long currentEmployeeId = user.getUID();
//排序配置
OrderRuleVO orderRule = getSalarySysConfService(user).orderRule();
param.setOrderRule(orderRule);
Boolean needAuth = getTaxAgentService().isNeedAuth(currentEmployeeId);
if (needAuth) {
List<TaxAgentEmployeeDTO> taxAgentEmployeeDTOS = getTaxAgentService().listTaxAgentAndEmployee(currentEmployeeId);