!15 福利台账

Merge pull request !15 from reset/archive
This commit is contained in:
reset 2022-04-12 02:25:50 +00:00 committed by Gitee
commit 9b907a7a36
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
9 changed files with 384 additions and 6 deletions

View File

@ -1,8 +1,12 @@
package com.engine.salary.biz;
import com.engine.salary.entity.siaccount.param.InsuranceAccountBatchParam;
import com.engine.salary.entity.siaccount.param.InsuranceAccountDetailParam;
import com.engine.salary.entity.siaccount.po.InsuranceAccountBatchPO;
import com.engine.salary.entity.siaccount.po.InsuranceAccountDetailPO;
import com.engine.salary.enums.siaccount.PaymentStatusEnum;
import com.engine.salary.mapper.siaccount.InsuranceAccountBatchMapper;
import com.engine.salary.mapper.siaccount.InsuranceAccountDetailMapper;
import com.engine.salary.util.page.PageInfo;
import com.engine.salary.util.page.PageUtil;
import org.apache.ibatis.session.SqlSession;
@ -32,4 +36,18 @@ public class SIAccountBiz {
}
}
public PageInfo<InsuranceAccountDetailPO> listCommonPage(InsuranceAccountDetailParam queryParam) {
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
try {
InsuranceAccountDetailMapper insuranceAccountDetailMapper = sqlSession.getMapper(InsuranceAccountDetailMapper.class);
PageUtil.start(queryParam.getCurrent(), queryParam.getPageSize());
queryParam.setPaymentStatus(PaymentStatusEnum.COMMON.getValue());
List<InsuranceAccountDetailPO> list = insuranceAccountDetailMapper.list(queryParam);
PageInfo<InsuranceAccountDetailPO> pageInfo = new PageInfo<>(list,InsuranceAccountDetailPO.class);
return pageInfo;
}finally {
sqlSession.close();
}
}
}

View File

@ -0,0 +1,22 @@
package com.engine.salary.entity.siaccount.param;
import com.engine.salary.common.BaseQueryParam;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @Author weaver_cl
* @Description: TODO
* @Date 2022/4/11
* @Version V1.0
**/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class InsuranceAccountDetailParam extends BaseQueryParam {
private String billMonth; //账单月份
private Integer paymentStatus;
}

View File

@ -0,0 +1,23 @@
package com.engine.salary.mapper.siaccount;
import com.engine.salary.entity.siaccount.param.InsuranceAccountDetailParam;
import com.engine.salary.entity.siaccount.po.InsuranceAccountDetailPO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @Author weaver_cl
* @Description: TODO
* @Date 2022/4/11
* @Version V1.0
**/
public interface InsuranceAccountDetailMapper {
/**
* 查询正常缴纳列表
* @param queryParam
* @return
*/
List<InsuranceAccountDetailPO> list(@Param("param")InsuranceAccountDetailParam queryParam);
}

View File

@ -0,0 +1,122 @@
<?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.InsuranceAccountDetailMapper">
<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="fund_pay_org" property="fundPayOrg"/>
<result column="fund_account" property="fundAccount"/>
<result column="supplement_fund_account" property="supplementFundAccount"/>
<result column="other_pay_org" property="otherPayOrg"/>
<result column="social_scheme_id" property="socialSchemeId"/>
<result column="social_payment_base_string" property="socialPaymentBaseString"/>
<result column="fund_scheme_id" property="fundSchemeId"/>
<result column="fund_payment_base_string" property="fundPaymentBaseString"/>
<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="delete_type" property="deleteType"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
<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.fund_pay_org
, t.fund_account
, t.supplement_fund_account
, t.other_pay_org
, t.social_scheme_id
, t.social_payment_base_string
, t.fund_scheme_id
, t.fund_payment_base_string
, 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.delete_type
, t.create_time
, t.update_time
, t.tenant_key
</sql>
<sql id="paramSql">
<if test="param.billMonth != null and param.billMonth != ''">
AND
t.bill_month = param.billMonth
</if>
<if test="param.paymentStatus != null and param.paymentStatus != ''">
AND
t.payment_status = param.paymentStatus
</if>
</sql>
<select id="list" resultMap="BaseResultMap">
SELECT
<include refid="baseColumns"/>
FROM
hrsa_bill_detail t
WHERE t.delete_type = 0
<include refid="paramSql"/>
ORDER BY t.update_time DESC
</select>
</mapper>

View File

@ -0,0 +1,22 @@
package com.engine.salary.service;
import com.engine.salary.entity.siaccount.po.InsuranceAccountDetailPO;
import com.engine.salary.entity.siaccount.po.InsuranceAccountInspectPO;
import java.util.List;
import java.util.Map;
/**
* @Author weaver_cl
* @Description: TODO
* @Date 2022/4/11
* @Version V1.0
**/
public interface RecordsBuildService {
List<Map<String, Object>> buildCommonRecords(List<InsuranceAccountDetailPO> list, Long employeeId);
List<Map<String, Object>> buildCommonRecordsWithStyle(List<InsuranceAccountDetailPO> list, Long employeeId);
List<Map<String, Object>> buildInspectRecords(List<InsuranceAccountInspectPO> list);
}

View File

@ -1,6 +1,7 @@
package com.engine.salary.service;
import com.engine.salary.entity.siaccount.param.InsuranceAccountBatchParam;
import com.engine.salary.entity.siaccount.param.InsuranceAccountDetailParam;
import java.util.Map;
@ -13,5 +14,5 @@ import java.util.Map;
public interface SIAccountService {
Map<String,Object> listPage(InsuranceAccountBatchParam insuranceAccountBatchParam);
Map<String,Object> listCommonPage(String billMonth);
Map<String,Object> listCommonPage(InsuranceAccountDetailParam insuranceAccountDetailParam);
}

View File

@ -0,0 +1,150 @@
package com.engine.salary.service.impl;
import com.alibaba.fastjson.JSON;
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
import com.engine.salary.entity.salaryarchive.po.TaxAgentPO;
import com.engine.salary.entity.siaccount.po.InsuranceAccountDetailPO;
import com.engine.salary.entity.siaccount.po.InsuranceAccountInspectPO;
import com.engine.salary.service.RecordsBuildService;
import com.engine.core.impl.Service;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.ibatis.binding.MapperProxy;
import org.apache.ibatis.binding.MapperProxyFactory;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
* @Author weaver_cl
* @Description: TODO
* @Date 2022/4/11
* @Version V1.0
**/
public class RecordsBuildServiceImpl extends Service implements RecordsBuildService {
@Override
public List<Map<String, Object>> buildCommonRecords(List<InsuranceAccountDetailPO> list, Long employeeId) {
List<Map<String, Object>> result = new ArrayList<>();
if (CollectionUtils.isEmpty(list)) {
return result;
}
List<Long> employeeIds = list.stream().map(item -> item.getEmployeeId()).collect(Collectors.toList());
// List<DataCollectionEmployee> employeeByIds = hrmCommonEmployeeService.getEmployeeByIds(employeeIds);
// if (CollectionUtils.isEmpty(employeeByIds)) {
// return result;
// }
// List<TaxAgentPO> paymentList = new LambdaQueryChainWrapper<>(individualTaxWithholdingAgentMapper)
// .eq(TaxAgentPO::getTenantKey, tenantKey)
// .list();
// SalaryAssert.notEmpty(paymentList, SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 100341, "该租户无扣缴义务人"));
// Map<Long, TaxAgentPO> paymentMap = paymentList.stream().collect(Collectors.toMap(TaxAgentPO::getId, Function.identity()));
// Map<Long, SimpleEmployee> collect = employeeByIds.stream().collect(Collectors.toMap(SimpleEmployee::getEmployeeId, Function.identity()));
// list.forEach(item -> {
// Map<String, Object> record = new HashMap<>();
// SimpleEmployee simpleEmployee = collect.get(item.getEmployeeId());
// record.put("id", item.getId());
// record.put("employeeId", item.getEmployeeId());
// record.put("billMonth", item.getBillMonth());
// record.put("billStatus", SalaryEnumUtil.enumMatchByValue(item.getBillStatus(), BillStatusEnum.values(), BillStatusEnum.class));
// record.put("userName", simpleEmployee.getUsername());
// record.put("department", simpleEmployee.getDepartment().getName());
// record.put("supplementaryMonth", item.getSupplementaryMonth());
// record.put("mobile", simpleEmployee.getMobile());
// record.put("employeeStatus", simpleEmployee.getStatus().getDescription());
// ResourceFromEnum from = SalaryEnumUtil.enumMatchByValue(item.getResourceFrom(), ResourceFromEnum.values(), ResourceFromEnum.class);
// record.put("sourceFrom", SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, from.getLabelId(), from.getDefaultLabel()));
// record.put("socialPayOrg", paymentMap.get(item.getSocialPayOrg()) == null ? "" : paymentMap.get(item.getSocialPayOrg()).getName());
// record.put("socialAccount", item.getSocialAccount());
// record.put("socialSchemeName", siSchemeService.querySchemeName(item.getSocialSchemeId()));
// if (StringUtils.isNotEmpty(item.getSocialPaymentBaseString())) {
// Map<String, Object> socialJson = JSON.parseObject(item.getSocialPaymentBaseString(), new HashMap<String, Object>().getClass());
// socialJson.forEach((k, v) -> {
// record.put(k + "socialBase", SalaryEntityUtil.thousandthConvert((String) v));
// });
// }
// record.put("fundPayOrg", item.getFundPayOrg() == null ? "" : paymentMap.get(item.getFundPayOrg()).getName());
// record.put("fundAccount", item.getFundAccount());
// record.put("fundSchemeName", siSchemeService.querySchemeName(item.getFundSchemeId()));
// record.put("supplementFundAccount", item.getSupplementFundAccount());
// if (StringUtils.isNotEmpty(item.getFundPaymentBaseString())) {
// Map<String, Object> socialJson = JSON.parseObject(item.getFundPaymentBaseString(), new HashMap<String, Object>().getClass());
// socialJson.forEach((k, v) -> {
// record.put(k + "fundBase", SalaryEntityUtil.thousandthConvert((String) v));
// });
// }
// record.put("otherPayOrg", item.getOtherPayOrg() == null ? "" : paymentMap.get(item.getOtherPayOrg()).getName());
// record.put("otherSchemeName", siSchemeService.querySchemeName(item.getOtherSchemeId()));
// if (StringUtils.isNotEmpty(item.getOtherPaymentBaseString())) {
// Map<String, Object> socialJson = JSON.parseObject(item.getOtherPaymentBaseString(), new HashMap<String, Object>().getClass());
// socialJson.forEach((k, v) -> {
// record.put(k + "otherBase", SalaryEntityUtil.thousandthConvert((String) v));
// });
// }
// if (StringUtils.isNotEmpty(item.getSocialPerJson())) {
// Map<String, Object> socialJson = JSON.parseObject(item.getSocialPerJson(), new HashMap<String, Object>().getClass());
// socialJson.forEach((k, v) -> {
// record.put(k + "socialPer", SalaryEntityUtil.thousandthConvert((String) v));
// });
// }
// record.put("socialPerSum", SalaryEntityUtil.thousandthConvert(item.getSocialPerSum()));
// if (StringUtils.isNotEmpty(item.getFundPerJson())) {
// Map<String, Object> fundPerJson = JSON.parseObject(item.getFundPerJson(), new HashMap<String, Object>().getClass());
// fundPerJson.forEach((k, v) -> {
// record.put(k + "fundPer", SalaryEntityUtil.thousandthConvert((String) v));
// });
// }
// record.put("fundPerSum", SalaryEntityUtil.thousandthConvert(item.getFundPerSum()));
// if (StringUtils.isNotEmpty(item.getOtherPerJson())) {
// Map<String, Object> fundPerJson = JSON.parseObject(item.getOtherPerJson(), new HashMap<String, Object>().getClass());
// fundPerJson.forEach((k, v) -> {
// record.put(k + "otherPer", SalaryEntityUtil.thousandthConvert((String) v));
// });
// }
// record.put("otherPerSum", SalaryEntityUtil.thousandthConvert(item.getOtherPerSum()));
// record.put("perSum", SalaryEntityUtil.thousandthConvert(item.getPerSum()));
// if (StringUtils.isNotEmpty(item.getSocialComJson())) {
// Map<String, Object> fundPerJson = JSON.parseObject(item.getSocialComJson(), new HashMap<String, Object>().getClass());
// fundPerJson.forEach((k, v) -> {
// record.put(k + "socialCom", SalaryEntityUtil.thousandthConvert((String) v));
// });
// }
// record.put("socialComSum", SalaryEntityUtil.thousandthConvert(item.getSocialComSum()));
// if (StringUtils.isNotEmpty(item.getFundComJson())) {
// Map<String, Object> fundPerJson = JSON.parseObject(item.getFundComJson(), new HashMap<String, Object>().getClass());
// fundPerJson.forEach((k, v) -> {
// record.put(k + "fundCom", SalaryEntityUtil.thousandthConvert((String) v));
// });
// }
// record.put("fundComSum", SalaryEntityUtil.thousandthConvert(item.getFundComSum()));
// if (StringUtils.isNotEmpty(item.getOtherComJson())) {
// Map<String, Object> fundPerJson = JSON.parseObject(item.getOtherComJson(), new HashMap<String, Object>().getClass());
// fundPerJson.forEach((k, v) -> {
// record.put(k + "otherCom", SalaryEntityUtil.thousandthConvert((String) v));
// });
// }
// record.put("otherComSum", SalaryEntityUtil.thousandthConvert(item.getOtherComSum()));
// record.put("comSum", SalaryEntityUtil.thousandthConvert(item.getComSum()));
// record.put("socialSum", SalaryEntityUtil.thousandthConvert(item.getSocialSum()));
// record.put("fundSum", SalaryEntityUtil.thousandthConvert(item.getFundSum()));
// record.put("otherSum", SalaryEntityUtil.thousandthConvert(item.getOtherSum()));
// record.put("total", SalaryEntityUtil.thousandthConvert(item.getTotal()));
//result.add(record);
//});
return result;
}
@Override
public List<Map<String, Object>> buildCommonRecordsWithStyle(List<InsuranceAccountDetailPO> list, Long employeeId) {
return null;
}
@Override
public List<Map<String, Object>> buildInspectRecords(List<InsuranceAccountInspectPO> list) {
return null;
}
}

View File

@ -1,18 +1,23 @@
package com.engine.salary.service.impl;
import com.cloudstore.eccom.result.WeaResultMsg;
import com.engine.common.util.ServiceUtil;
import com.engine.core.impl.Service;
import com.engine.salary.biz.SIAccountBiz;
import com.engine.salary.component.SalaryWeaTable;
import com.engine.salary.entity.siaccount.bo.InsuranceAccountBO;
import com.engine.salary.entity.siaccount.dto.InsuranceAccountBatchListDTO;
import com.engine.salary.entity.siaccount.param.InsuranceAccountBatchParam;
import com.engine.salary.entity.siaccount.param.InsuranceAccountDetailParam;
import com.engine.salary.entity.siaccount.po.InsuranceAccountBatchPO;
import com.engine.salary.entity.siaccount.po.InsuranceAccountDetailPO;
import com.engine.salary.service.RecordsBuildService;
import com.engine.salary.service.SIAccountService;
import java.util.*;
import com.engine.salary.util.page.PageInfo;
import weaver.hrm.User;
/**
@ -25,6 +30,10 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
private SIAccountBiz siAccountBiz = new SIAccountBiz();
public RecordsBuildService getService(User user) {
return ServiceUtil.getService(RecordsBuildServiceImpl.class,user);
}
@Override
public Map<String, Object> listPage(InsuranceAccountBatchParam queryParam) {
Long employeeId = (long)user.getUID();
@ -85,10 +94,21 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
}
@Override
public Map<String, Object> listCommonPage(String billMonth) {
public Map<String, Object> listCommonPage(InsuranceAccountDetailParam queryParam) {
Long employeeId = (long)user.getUID();
Map<String,Object> datas = new HashMap<>();
return null;
//正常缴纳列表
PageInfo<InsuranceAccountDetailPO> pageInfo = siAccountBiz.listCommonPage(queryParam);
List<InsuranceAccountDetailPO> insuranceAccountDetailPOS = pageInfo.getList();
//数据组装
List<Map<String, Object>> records = getService(user).buildCommonRecords(insuranceAccountDetailPOS, employeeId);
return datas;
}
}

View File

@ -1,8 +1,8 @@
package com.engine.salary.web;
import com.engine.common.util.ServiceUtil;
import com.engine.salary.entity.salaryarchive.param.SalaryArchiveQueryParam;
import com.engine.salary.entity.siaccount.param.InsuranceAccountBatchParam;
import com.engine.salary.entity.siaccount.param.InsuranceAccountDetailParam;
import com.engine.salary.service.SIAccountService;
import com.engine.salary.service.impl.SIAccountServiceImpl;
import com.engine.salary.util.ResponseResult;
@ -47,9 +47,9 @@ public class SIAccountController {
@Path("/detail/common/list")
@Produces(MediaType.APPLICATION_JSON)
public String commonList(@Context HttpServletRequest request, @Context HttpServletResponse response,
@QueryParam("billMonth") String billMonth) {
@RequestBody InsuranceAccountDetailParam insuranceAccountDetailParam) {
User user = HrmUserVarify.getUser(request, response);
return new ResponseResult<String, Map<String, Object>>().run(getService(user)::listCommonPage, billMonth);
return new ResponseResult<InsuranceAccountDetailParam, Map<String, Object>>().run(getService(user)::listCommonPage, insuranceAccountDetailParam);
}