commit
64eff51ab2
|
|
@ -0,0 +1,13 @@
|
|||
package com.api.salary.web;
|
||||
|
||||
import javax.ws.rs.Path;
|
||||
|
||||
/**
|
||||
* @Author weaver_cl
|
||||
* @Description: TODO
|
||||
* @Date 2022/3/11
|
||||
* @Version V1.0
|
||||
**/
|
||||
@Path("/bs/hrmsalary/archives")
|
||||
public class SIArchivesController extends com.engine.salary.web.SIArchivesController {
|
||||
}
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
package com.engine.salary.biz;
|
||||
|
||||
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
||||
import com.engine.salary.entity.sicategory.dto.ICategoryFormDTO;
|
||||
import com.engine.salary.util.SalaryAssert;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* @Author weaver_cl
|
||||
* @Description: TODO
|
||||
* @Date 2022/3/12
|
||||
* @Version V1.0
|
||||
**/
|
||||
public class SIArchivesBiz {
|
||||
|
||||
public ICategoryFormDTO getBaseForm(Integer welfareType, Long employeeId) {
|
||||
SalaryAssert.notNull(employeeId, "员工id不可为空");
|
||||
EmployBiz employBiz = new EmployBiz();
|
||||
List<DataCollectionEmployee> employeeByIds = employBiz.getEmployeeByIds(Collections.singletonList(employeeId));
|
||||
SalaryAssert.notEmpty(employeeByIds,"员工信息不存在");
|
||||
DataCollectionEmployee item = employeeByIds.get(0);
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
package com.engine.salary.biz;
|
||||
|
||||
import com.engine.salary.constant.SalaryDefaultTenantConstant;
|
||||
import com.engine.salary.entity.sicategory.po.ICategoryPO;
|
||||
import com.engine.salary.entity.sischeme.bo.InsuranceSchemeBO;
|
||||
import com.engine.salary.entity.sischeme.dto.InsuranceSchemeDTO;
|
||||
import com.engine.salary.entity.sischeme.dto.InsuranceSchemeDetailDTO;
|
||||
|
|
@ -9,18 +10,23 @@ import com.engine.salary.entity.sischeme.po.InsuranceSchemeDetailPO;
|
|||
import com.engine.salary.entity.sischeme.po.InsuranceSchemePO;
|
||||
import com.engine.salary.entity.sischeme.vo.InsuranceSchemeFormVO;
|
||||
|
||||
import com.engine.salary.enums.sicategory.DeleteTypeEnum;
|
||||
import com.engine.salary.enums.sicategory.WelfareTypeEnum;
|
||||
import com.engine.salary.enums.sicategory.*;
|
||||
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import com.engine.salary.mapper.sicategory.ICategoryMapper;
|
||||
import com.engine.salary.mapper.sischeme.InsuranceSchemeDetailMapper;
|
||||
import com.engine.salary.mapper.sischeme.InsuranceSchemeMapper;
|
||||
import com.mzlion.core.utils.BeanUtils;
|
||||
import com.engine.salary.util.SalaryAssert;
|
||||
import com.engine.salary.util.SalaryEnumUtil;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.ibatis.session.SqlSession;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import weaver.conn.mybatis.MyBatisFactory;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
|
|
@ -36,24 +42,137 @@ public class SISchemeBiz {
|
|||
/**
|
||||
* 获取社保方案
|
||||
* @param id
|
||||
* @param welfareTypeEnum
|
||||
* @return
|
||||
*/
|
||||
public InsuranceSchemeFormVO getForm(Long id, WelfareTypeEnum welfareTypeEnum) {
|
||||
InsuranceSchemeDTO insuranceSchemeDTO = getSchemeFormDTO(welfareTypeEnum,id);
|
||||
List<InsuranceSchemeDetailDTO> insuranceSchemeDetailDTOList = getSchemeDetailFormDTO(welfareTypeEnum,id);
|
||||
return InsuranceSchemeFormVO.builder().schemeBatch(insuranceSchemeDTO).schemeDetailList(insuranceSchemeDetailDTOList).build();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取方案明细表集合 新建|详情
|
||||
*
|
||||
* @param welfareTypeEnum 福利类型
|
||||
* @param id 方案主键id
|
||||
* @return form
|
||||
*/
|
||||
private List<InsuranceSchemeDetailDTO> getSchemeDetailFormDTO(WelfareTypeEnum welfareTypeEnum, Long id) {
|
||||
List<ICategoryPO> insuranceCategoryPOS = listByWelfareType(welfareTypeEnum.getValue());
|
||||
List<InsuranceSchemeDetailDTO> insuranceSchemeDetailDTOList = new ArrayList<>();
|
||||
insuranceCategoryPOS.forEach(item -> {
|
||||
PaymentScopeEnum[] paymentScopeEnums = SalaryEnumUtil.stringToEnums(item.getPaymentScope(), ",");
|
||||
Arrays.stream(paymentScopeEnums).forEach(e -> {
|
||||
InsuranceSchemeDetailDTO insuranceSchemeDetailDTO = InsuranceSchemeDetailDTO.builder().build();
|
||||
InsuranceSchemeDetailPO insuranceSchemeDetailPO = getByPPI(id,e.getValue(),item.getId());
|
||||
if (insuranceSchemeDetailPO == null) {
|
||||
insuranceSchemeDetailDTO = InsuranceSchemeDetailDTO.builder()
|
||||
.id((long) (Math.random() * 10000))
|
||||
.insuranceId(item.getId())
|
||||
.insuranceName(item.getInsuranceName())
|
||||
.paymentScope(e.getDefaultLabel())
|
||||
.rententionRule(String.valueOf(RententionRuleEnum.ROUND.getValue()))
|
||||
.build();
|
||||
if (Objects.equals(item.getDataType(), DataTypeEnum.SYSTEM.getValue())) {
|
||||
insuranceSchemeDetailDTO.setIsPayment(true);
|
||||
} else {
|
||||
insuranceSchemeDetailDTO.setIsPayment(false);
|
||||
}
|
||||
} else {
|
||||
//BeanUtils.copyProperties(insuranceSchemeDetailPO, insuranceSchemeDetailDTO);
|
||||
insuranceSchemeDetailDTO.setEffectiveTime(insuranceSchemeDetailPO.getEffectiveTime());
|
||||
insuranceSchemeDetailDTO.setExpirationTime(insuranceSchemeDetailPO.getExpirationTime());
|
||||
insuranceSchemeDetailDTO.setId(insuranceSchemeDetailPO.getId());
|
||||
insuranceSchemeDetailDTO.setInsuranceId(insuranceSchemeDetailPO.getInsuranceId());
|
||||
insuranceSchemeDetailDTO.setPaymentScopeValue(insuranceSchemeDetailPO.getPaymentScope());
|
||||
insuranceSchemeDetailDTO.setPrimaryId(insuranceSchemeDetailPO.getPrimaryId());
|
||||
insuranceSchemeDetailDTO.setValidNum(insuranceSchemeDetailPO.getValidNum());
|
||||
|
||||
if (insuranceSchemeDetailPO.getIsPayment() != null) {
|
||||
insuranceSchemeDetailDTO.setIsPayment(Objects.equals(insuranceSchemeDetailPO.getIsPayment(), IsPaymentEnum.YES.getValue()));
|
||||
}
|
||||
if (StringUtils.isNotBlank(insuranceSchemeDetailPO.getUpperLimit())) {
|
||||
BigDecimal bigDecimal = new BigDecimal(insuranceSchemeDetailPO.getUpperLimit());
|
||||
insuranceSchemeDetailDTO.setUpperLimit(numberCheck(bigDecimal.toPlainString()) ? null : bigDecimal);
|
||||
}
|
||||
if (StringUtils.isNotBlank(insuranceSchemeDetailPO.getLowerLimit())) {
|
||||
BigDecimal bigDecimal = new BigDecimal(insuranceSchemeDetailPO.getLowerLimit());
|
||||
insuranceSchemeDetailDTO.setLowerLimit(numberCheck(bigDecimal.toPlainString()) ? null : bigDecimal);
|
||||
}
|
||||
if (StringUtils.isNotBlank(insuranceSchemeDetailPO.getPaymentProportion())) {
|
||||
BigDecimal bigDecimal = new BigDecimal(insuranceSchemeDetailPO.getPaymentProportion());
|
||||
insuranceSchemeDetailDTO.setPaymentProportion(numberCheck(bigDecimal.toPlainString()) ? null : bigDecimal);
|
||||
}
|
||||
if (StringUtils.isNotBlank(insuranceSchemeDetailPO.getFixedCost())) {
|
||||
BigDecimal bigDecimal = new BigDecimal(insuranceSchemeDetailPO.getFixedCost());
|
||||
insuranceSchemeDetailDTO.setFixedCost(numberCheck(bigDecimal.toPlainString()) ? null : bigDecimal);
|
||||
}
|
||||
insuranceSchemeDetailDTO.setInsuranceName(item.getInsuranceName());
|
||||
insuranceSchemeDetailDTO.setRententionRule(String.valueOf(insuranceSchemeDetailPO.getRententionRule()));
|
||||
insuranceSchemeDetailDTO.setPaymentScope(e.getDefaultLabel());
|
||||
|
||||
}
|
||||
insuranceSchemeDetailDTO.setPaymentScopeValue(e.getValue());
|
||||
insuranceSchemeDetailDTOList.add(insuranceSchemeDetailDTO);
|
||||
});
|
||||
});
|
||||
return insuranceSchemeDetailDTOList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据福利类型获取
|
||||
* @param welfareType
|
||||
* @return
|
||||
*/
|
||||
public InsuranceSchemeFormVO getForm(Long id, WelfareTypeEnum welfareType) {
|
||||
|
||||
if (id != null) {
|
||||
//查询社保方案基础信息主表
|
||||
InsuranceSchemePO insuranceSchemePO = getById(id);
|
||||
InsuranceSchemeDTO insuranceSchemeDTO = new InsuranceSchemeDTO();
|
||||
BeanUtils.copyProperties(insuranceSchemePO,insuranceSchemeDTO);
|
||||
//查询社保方案基础信息明细表
|
||||
List<InsuranceSchemeDetailPO> insuranceSchemeDetailPOS = listByPrimaryId(id);
|
||||
List<InsuranceSchemeDetailDTO> insuranceSchemeDetailDTOS = new ArrayList<>();
|
||||
BeanUtils.copyProperties(insuranceSchemeDetailPOS,insuranceSchemeDetailDTOS);
|
||||
return InsuranceSchemeFormVO.builder().schemeBatch(insuranceSchemeDTO).schemeDetailList(insuranceSchemeDetailDTOS).build();
|
||||
private List<ICategoryPO> listByWelfareType(Integer welfareType) {
|
||||
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
|
||||
try {
|
||||
ICategoryMapper iCategoryMapper = sqlSession.getMapper(ICategoryMapper.class);
|
||||
List<ICategoryPO> insuranceCategoryPOS = iCategoryMapper.listByWelfareType(welfareType);
|
||||
return insuranceCategoryPOS;
|
||||
} finally {
|
||||
sqlSession.close();
|
||||
}
|
||||
}
|
||||
|
||||
return InsuranceSchemeFormVO.builder().build();
|
||||
public boolean numberCheck(String number) {
|
||||
return Pattern.compile("^0\\.[0]*").matcher(number).matches();
|
||||
}
|
||||
|
||||
private InsuranceSchemeDetailPO getByPPI(Long primaryId, Integer paymentScope, Long insuranceId) {
|
||||
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
|
||||
try {
|
||||
InsuranceSchemeDetailMapper insuranceSchemeDetailMapper = sqlSession.getMapper(InsuranceSchemeDetailMapper.class);
|
||||
InsuranceSchemeDetailPO insuranceSchemeDetailPO = insuranceSchemeDetailMapper.getByPPI(primaryId, paymentScope, insuranceId);
|
||||
return insuranceSchemeDetailPO;
|
||||
}finally {
|
||||
sqlSession.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取方案主表信息 新建|详情
|
||||
*
|
||||
* @param welfareTypeEnum 福利类型
|
||||
* @param id 方案主键id
|
||||
* @return form
|
||||
*/
|
||||
private InsuranceSchemeDTO getSchemeFormDTO(WelfareTypeEnum welfareTypeEnum, Long id) {
|
||||
InsuranceSchemeDTO insuranceSchemeDTO = InsuranceSchemeDTO.builder().paymentType(PaymentTypeEnum.SCHEME_TOWN).welfareType(welfareTypeEnum).build();
|
||||
if (id != null) {
|
||||
InsuranceSchemePO insuranceSchemePO = getById(id);
|
||||
SalaryAssert.notNull(insuranceSchemePO,"福利方案不存在");
|
||||
//BeanUtils.copyProperties(insuranceSchemePO, insuranceSchemeDTO);
|
||||
insuranceSchemeDTO.setId(insuranceSchemePO.getId());
|
||||
insuranceSchemeDTO.setPaymentArea(insuranceSchemePO.getPaymentArea());
|
||||
insuranceSchemeDTO.setRemarks(insuranceSchemePO.getRemarks());
|
||||
insuranceSchemeDTO.setSchemeName(insuranceSchemePO.getSchemeName());
|
||||
insuranceSchemeDTO.setPaymentType(SalaryEnumUtil.enumMatchByValue(insuranceSchemePO.getPaymentType(), PaymentTypeEnum.values(), PaymentTypeEnum.class));
|
||||
insuranceSchemeDTO.setWelfareType(welfareTypeEnum);
|
||||
}
|
||||
return insuranceSchemeDTO;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -0,0 +1,50 @@
|
|||
package com.engine.salary.cmd.archives;
|
||||
|
||||
import com.api.browser.bean.SearchConditionItem;
|
||||
import com.api.browser.util.ConditionFactory;
|
||||
import com.engine.common.biz.AbstractCommonCommand;
|
||||
import com.engine.common.entity.BizLogContext;
|
||||
import com.engine.core.interceptor.CommandContext;
|
||||
import com.engine.salary.biz.SIArchivesBiz;
|
||||
import com.engine.salary.biz.SICategoryBiz;
|
||||
import com.engine.salary.entity.sicategory.dto.ICategoryFormDTO;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author weaver_cl
|
||||
* @Description: TODO
|
||||
* @Date 2022/3/12
|
||||
* @Version V1.0
|
||||
**/
|
||||
public class SIArchivesGetBaseFormCmd extends AbstractCommonCommand<Map<String, Object>> {
|
||||
|
||||
|
||||
public SIArchivesGetBaseFormCmd(Map<String, Object> params, User user) {
|
||||
this.user = user;
|
||||
this.params = params;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BizLogContext getLogContext() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> execute(CommandContext commandContext) {
|
||||
Map<String, Object> apidatas = new HashMap<>(16);
|
||||
SIArchivesBiz siArchivesBiz = new SIArchivesBiz();
|
||||
Integer welfareType = (Integer) params.get("welfareType");
|
||||
Long employeeId = (Long) params.get("employeeId");
|
||||
ICategoryFormDTO form = siArchivesBiz.getBaseForm(welfareType,employeeId);
|
||||
apidatas.put("form",form);
|
||||
|
||||
ConditionFactory conditionFactory = new ConditionFactory(user);
|
||||
Map<String, SearchConditionItem> items = new HashMap<>();
|
||||
|
||||
|
||||
return apidatas;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
package com.engine.salary.cmd.archives;
|
||||
|
||||
import com.engine.common.biz.AbstractCommonCommand;
|
||||
import com.engine.common.entity.BizLogContext;
|
||||
import com.engine.core.interceptor.CommandContext;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author weaver_cl
|
||||
* @Description: TODO
|
||||
* @Date 2022/3/12
|
||||
* @Version V1.0
|
||||
**/
|
||||
public class SIArchivesTipsCmd extends AbstractCommonCommand<Map<String, Object>> {
|
||||
|
||||
public SIArchivesTipsCmd(Map<String, Object> params, User user) {
|
||||
this.user = user;
|
||||
this.params = params;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BizLogContext getLogContext() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> execute(CommandContext commandContext) {
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
@ -11,6 +11,7 @@ import weaver.hrm.User;
|
|||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @Author weaver_cl
|
||||
|
|
@ -34,9 +35,12 @@ public class SISchemeGetFormCmd extends AbstractCommonCommand<Map<String, Object
|
|||
public Map<String, Object> execute(CommandContext commandContext) {
|
||||
Map<String, Object> apidatas = new HashMap<>(16);
|
||||
SISchemeBiz siSchemeBiz = new SISchemeBiz();
|
||||
Long id = Long.valueOf(Util.null2String(params.get("id")));
|
||||
WelfareTypeEnum welfareType = (WelfareTypeEnum)params.get("welfareTypeEnum");
|
||||
InsuranceSchemeFormVO form = siSchemeBiz.getForm(id, welfareType);
|
||||
Long id = null;
|
||||
if (Objects.nonNull(params.get("id"))) {
|
||||
id =Long.valueOf(Util.null2String(params.get("id")));
|
||||
}
|
||||
WelfareTypeEnum welfareTypeEnum = (WelfareTypeEnum)params.get("welfareTypeEnum");
|
||||
InsuranceSchemeFormVO form = siSchemeBiz.getForm(id, welfareTypeEnum);
|
||||
apidatas.put("form",form);
|
||||
return apidatas;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,111 @@
|
|||
package com.engine.salary.entity.siarchives.po;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Author weaver_cl
|
||||
* @Description: 公积金档案表 hrsa_fund_archives
|
||||
* @Date 2022/3/12
|
||||
* @Version V1.0
|
||||
**/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class InsuranceArchivesFundSchemePO {
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 员工id
|
||||
*/
|
||||
private Long employeeId;
|
||||
|
||||
/**
|
||||
* 福利类型
|
||||
*/
|
||||
private Integer welfareType;
|
||||
|
||||
/**
|
||||
* 暂不缴纳
|
||||
*/
|
||||
private Integer nonPayment;
|
||||
|
||||
/**
|
||||
* 公积金起始缴纳月
|
||||
*/
|
||||
private String fundStartTime;
|
||||
|
||||
/**
|
||||
* 公积金最后缴纳月
|
||||
*/
|
||||
private String fundEndTime;
|
||||
|
||||
/**
|
||||
* 公积金方案名称
|
||||
*/
|
||||
/*@ElogTransform(name = "公积金方案名称")
|
||||
private String fundName;*/
|
||||
|
||||
/**
|
||||
* 公积金方案id
|
||||
*/
|
||||
private Long fundSchemeId;
|
||||
|
||||
/**
|
||||
* 公积金账号
|
||||
*/
|
||||
private String fundAccount;
|
||||
|
||||
/**
|
||||
* 补充公积金账号
|
||||
*/
|
||||
private String supplementFundAccount;
|
||||
|
||||
/**
|
||||
* 公积金缴纳组织
|
||||
*/
|
||||
private Long paymentOrganization;
|
||||
|
||||
/**
|
||||
* 公积金个人实际承担方
|
||||
*/
|
||||
private Integer underTake;
|
||||
|
||||
/**
|
||||
* 公积金缴纳基数
|
||||
*/
|
||||
private String fundPaymentBaseString;
|
||||
|
||||
/**
|
||||
* 租户key
|
||||
*/
|
||||
private String tenantKey;
|
||||
|
||||
/**
|
||||
* 创建人id
|
||||
*/
|
||||
private Long creator;
|
||||
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
private Integer deleteType;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
}
|
||||
|
|
@ -0,0 +1,101 @@
|
|||
package com.engine.salary.entity.siarchives.po;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Author weaver_cl
|
||||
* @Description: TODO hrsa_other_archives 其他福利档案表
|
||||
* @Date 2022/3/12
|
||||
* @Version V1.0
|
||||
**/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class InsuranceArchivesOtherSchemePO {
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 员工id
|
||||
*/
|
||||
private Long employeeId;
|
||||
|
||||
/**
|
||||
* 暂不缴纳
|
||||
*/
|
||||
private Integer nonPayment;
|
||||
|
||||
/**
|
||||
* 福利类型
|
||||
*/
|
||||
private Integer welfareType;
|
||||
|
||||
/**
|
||||
* 其他福利起始缴纳月
|
||||
*/
|
||||
private String otherStartTime;
|
||||
|
||||
/**
|
||||
* 其他福利最后缴纳月
|
||||
*/
|
||||
private String otherEndTime;
|
||||
|
||||
/**
|
||||
* 其他福利方案名称
|
||||
*/
|
||||
/*@ElogTransform(name = "其他福利方案名称")
|
||||
private String otherName;*/
|
||||
|
||||
/**
|
||||
* 其他福利方案id
|
||||
*/
|
||||
private Long otherSchemeId;
|
||||
|
||||
/**
|
||||
* 其他福利缴纳组织
|
||||
*/
|
||||
private Long paymentOrganization;
|
||||
|
||||
/**
|
||||
* 其他福利个人实际承担方
|
||||
*/
|
||||
private Integer underTake;
|
||||
|
||||
/**
|
||||
* 其他福利缴纳基数
|
||||
*/
|
||||
private String otherPaymentBaseString;
|
||||
|
||||
/**
|
||||
* 租户key
|
||||
*/
|
||||
private String tenantKey;
|
||||
|
||||
/**
|
||||
* 创建人id
|
||||
*/
|
||||
private Long creator;
|
||||
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
private Integer deleteType;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
}
|
||||
|
|
@ -0,0 +1,108 @@
|
|||
package com.engine.salary.entity.siarchives.po;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Author weaver_cl
|
||||
* @Description: TODO hrsa_social_archives 社保档案表
|
||||
* @Date 2022/3/12
|
||||
* @Version V1.0
|
||||
**/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
|
||||
public class InsuranceArchivesSocialSchemePO {
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 员工id
|
||||
*/
|
||||
private Long employeeId;
|
||||
|
||||
/**
|
||||
* 暂不缴纳
|
||||
*/
|
||||
private Integer nonPayment;
|
||||
|
||||
/**
|
||||
* 福利类型
|
||||
*/
|
||||
private Integer welfareType;
|
||||
|
||||
/**
|
||||
* 社保起始缴纳月
|
||||
*/
|
||||
private String socialStartTime;
|
||||
|
||||
/**
|
||||
* 社保最后缴纳月
|
||||
*/
|
||||
private String socialEndTime;
|
||||
|
||||
/**
|
||||
* 社保方案名称
|
||||
*/
|
||||
/* @ElogTransform(name = "社保方案名称")
|
||||
private String socialName;*/
|
||||
|
||||
/**
|
||||
* 社保方案id
|
||||
*/
|
||||
private Long socialSchemeId;
|
||||
|
||||
/**
|
||||
* 社保账号
|
||||
*/
|
||||
private String socialAccount;
|
||||
|
||||
/**
|
||||
* 社保缴纳组织
|
||||
*/
|
||||
private Long paymentOrganization;
|
||||
|
||||
/**
|
||||
* 社保个人实际承担方
|
||||
*/
|
||||
private Integer underTake;
|
||||
|
||||
/**
|
||||
* 社保缴纳基数
|
||||
*/
|
||||
private String socialPaymentBaseString;
|
||||
|
||||
/**
|
||||
* 租户key
|
||||
*/
|
||||
private String tenantKey;
|
||||
|
||||
/**
|
||||
* 创建人id
|
||||
*/
|
||||
private Long creator;
|
||||
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
private Integer deleteType;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
}
|
||||
|
|
@ -12,3 +12,10 @@ alter table hrsa_scheme_detail modify id bigint auto_increment;
|
|||
alter table hrsa_insurance_category modify id bigint auto_increment;
|
||||
|
||||
|
||||
--福利台账
|
||||
alter table hrsa_social_archives modify id bigint auto_increment;
|
||||
alter table hrsa_fund_archives modify id bigint auto_increment;
|
||||
alter table hrsa_other_archives modify id bigint auto_increment;
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
package com.engine.salary.mapper.sicategory;
|
||||
|
||||
import com.engine.salary.entity.sicategory.po.ICategoryPO;
|
||||
import com.engine.salary.enums.sicategory.WelfareTypeEnum;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -50,4 +52,10 @@ public interface ICategoryMapper {
|
|||
*/
|
||||
void updateById(ICategoryPO iCategoryPO);
|
||||
|
||||
/**
|
||||
* 根据类型查询福利类型
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<ICategoryPO> listByWelfareType(@Param("welfareType") Integer welfareType);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,6 +39,8 @@
|
|||
WHERE id = #{id} AND delete_type = 0
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<!-- 插入全部字段 -->
|
||||
<insert id="insert" parameterType="com.engine.salary.entity.sicategory.po.ICategoryPO"
|
||||
keyProperty="id" keyColumn="id" useGeneratedKeys="true"
|
||||
|
|
@ -81,6 +83,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
|
||||
ORDER BY id DESC
|
||||
</select>
|
||||
|
||||
<!-- 更新,更新修改字段 -->
|
||||
<update id="update" parameterType="com.engine.salary.entity.sicategory.po.ICategoryPO">
|
||||
UPDATE hrsa_insurance_category
|
||||
|
|
|
|||
|
|
@ -45,4 +45,7 @@ public interface InsuranceSchemeDetailMapper {
|
|||
*/
|
||||
List<InsuranceSchemeDetailPO> queryListByInsuranceIdIsPayment(@Param("insuranceId") Long insuranceId, @Param("isPayment") Integer isPayment);
|
||||
|
||||
|
||||
InsuranceSchemeDetailPO getByPPI(@Param("primaryId") Long primaryId, @Param("paymentScope") Integer paymentScope,
|
||||
@Param("insuranceId") Long insuranceId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,6 +45,26 @@
|
|||
</sql>
|
||||
|
||||
|
||||
<sql id="formColumns">
|
||||
t.id
|
||||
, t.primary_id
|
||||
, t.insurance_id
|
||||
, t.is_payment
|
||||
, t.payment_scope
|
||||
, t.payment_proportion
|
||||
, t.fixed_cost
|
||||
, t.valid_num
|
||||
, t.rentention_rule
|
||||
, t.create_time
|
||||
, t.update_time
|
||||
, t.creator
|
||||
, t.delete_type
|
||||
, t.tenant_key
|
||||
</sql>
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- 根据主键获取单条记录 -->
|
||||
<select id="listByPrimaryId" resultMap="BaseResultMap" parameterType="Long">
|
||||
SELECT
|
||||
|
|
@ -53,6 +73,22 @@
|
|||
WHERE t.primary_id = #{primaryId} AND delete_type = 0
|
||||
</select>
|
||||
|
||||
<sql id="paramSql">
|
||||
<if test="primaryId != null and primaryId != ''">
|
||||
AND primary_id = #{primaryId}
|
||||
</if>
|
||||
</sql>
|
||||
|
||||
<select id="getByPPI" resultMap="BaseResultMap" >
|
||||
SELECT
|
||||
<include refid="baseColumns"/>
|
||||
FROM hrsa_scheme_detail t
|
||||
WHERE t.insurance_id = #{insuranceId}
|
||||
AND t.payment_scope = #{paymentScope}
|
||||
AND t.primary_id = #{primaryId}
|
||||
AND delete_type = 0
|
||||
</select>
|
||||
|
||||
<!-- 插入全部字段 -->
|
||||
<insert id="insert" parameterType="com.engine.salary.entity.sischeme.po.InsuranceSchemeDetailPO"
|
||||
keyProperty="id" keyColumn="id" useGeneratedKeys="true"
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
package com.engine.salary.mapper.sischeme;
|
||||
|
||||
import com.engine.salary.entity.sischeme.po.InsuranceSchemeDetailPO;
|
||||
import com.engine.salary.entity.sischeme.po.InsuranceSchemePO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -40,4 +42,6 @@ public interface InsuranceSchemeMapper {
|
|||
* @return
|
||||
*/
|
||||
List<InsuranceSchemePO> listByName(String schemeName);
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,16 @@
|
|||
package com.engine.salary.service;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author weaver_cl
|
||||
* @Description: TODO
|
||||
* @Date 2022/3/11
|
||||
* @Version V1.0
|
||||
**/
|
||||
public interface SIArchivesService {
|
||||
|
||||
Map<String, Object> getTips(Map<String, Object> params);
|
||||
|
||||
Map<String, Object> getBaseForm(Map<String, Object> params);
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
package com.engine.salary.service.impl;
|
||||
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.cmd.archives.SIArchivesTipsCmd;
|
||||
import com.engine.salary.service.SIArchivesService;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author weaver_cl
|
||||
* @Description: TODO
|
||||
* @Date 2022/3/11
|
||||
* @Version V1.0
|
||||
**/
|
||||
public class SIArchivesServiceImpl extends Service implements SIArchivesService {
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getTips(Map<String, Object> params) {
|
||||
return commandExecutor.execute(new SIArchivesTipsCmd(params,user));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getBaseForm(Map<String, Object> params) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,68 @@
|
|||
package com.engine.salary.web;
|
||||
|
||||
import com.engine.common.util.ParamUtil;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.salary.entity.sischeme.dto.InsuranceSchemeDTO;
|
||||
import com.engine.salary.enums.sicategory.WelfareTypeEnum;
|
||||
import com.engine.salary.service.SIArchivesService;
|
||||
import com.engine.salary.service.impl.SIArchivesServiceImpl;
|
||||
import com.engine.salary.util.ResponseResult;
|
||||
import weaver.hrm.HrmUserVarify;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.ws.rs.*;
|
||||
import javax.ws.rs.core.Context;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @Author weaver_cl
|
||||
* @Description: TODO
|
||||
* @Date 2022/3/11
|
||||
* @Version V1.0
|
||||
**/
|
||||
public class SIArchivesController {
|
||||
|
||||
private SIArchivesService getService(User user) {
|
||||
return ServiceUtil.getService(SIArchivesServiceImpl.class,user);
|
||||
}
|
||||
|
||||
|
||||
@GET
|
||||
@Path("/tips")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String tips(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return ResponseResult.run(getService(user)::getTips, ParamUtil.request2Map(request));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询档案基本信息表单
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@GET
|
||||
@Path("/getBaseForm")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String getBaseForm(@Context HttpServletRequest request, @Context HttpServletResponse response,
|
||||
@DefaultValue("") @QueryParam(value = "welfareTypeEnum") WelfareTypeEnum welfareTypeEnum,
|
||||
@QueryParam(value = "employeeId") Long employeeId) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
Map<String, Object> map = ParamUtil.request2Map(request);
|
||||
if (Objects.nonNull(welfareTypeEnum)){
|
||||
InsuranceSchemeDTO insuranceSchemeDTO = InsuranceSchemeDTO.builder().welfareType(welfareTypeEnum).build();
|
||||
Integer welfareType = insuranceSchemeDTO.getWelfareType().getValue();
|
||||
map.put("welfareType",welfareType);
|
||||
}
|
||||
map.put("employeeId",employeeId);
|
||||
return ResponseResult.run(getService(user)::getBaseForm, ParamUtil.request2Map(request));
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -10,8 +10,6 @@ import com.engine.salary.service.SICategoryService;
|
|||
import com.engine.salary.service.impl.SICategoryServiceImpl;
|
||||
import com.engine.salary.util.ResponseResult;
|
||||
import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import weaver.hrm.HrmUserVarify;
|
||||
import weaver.hrm.User;
|
||||
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ import javax.ws.rs.core.Context;
|
|||
import javax.ws.rs.core.MediaType;
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @Author weaver_cl
|
||||
|
|
@ -42,9 +43,13 @@ public class SISchemeController {
|
|||
@GET
|
||||
@Path("/getForm")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String getForm(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
public String getForm(@Context HttpServletRequest request, @Context HttpServletResponse response,
|
||||
@DefaultValue("SOCIAL_SECURITY") @QueryParam(value = "welfareTypeEnum") WelfareTypeEnum welfareTypeEnum) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return ResponseResult.run(getService(user)::getForm, ParamUtil.request2Map(request));
|
||||
Map<String, Object> map = ParamUtil.request2Map(request);
|
||||
//InsuranceSchemeDTO insuranceSchemeDTO = InsuranceSchemeDTO.builder().welfareType(welfareTypeEnum).build();
|
||||
map.put("welfareTypeEnum",welfareTypeEnum);
|
||||
return ResponseResult.run(getService(user)::getForm, map);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue