diff --git a/src/com/api/salary/web/SIArchivesController.java b/src/com/api/salary/web/SIArchivesController.java new file mode 100644 index 000000000..bf3aa3fcd --- /dev/null +++ b/src/com/api/salary/web/SIArchivesController.java @@ -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 { +} diff --git a/src/com/engine/salary/biz/SIArchivesBiz.java b/src/com/engine/salary/biz/SIArchivesBiz.java new file mode 100644 index 000000000..085ae0194 --- /dev/null +++ b/src/com/engine/salary/biz/SIArchivesBiz.java @@ -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 employeeByIds = employBiz.getEmployeeByIds(Collections.singletonList(employeeId)); + SalaryAssert.notEmpty(employeeByIds,"员工信息不存在"); + DataCollectionEmployee item = employeeByIds.get(0); + return null; + + } +} diff --git a/src/com/engine/salary/biz/SISchemeBiz.java b/src/com/engine/salary/biz/SISchemeBiz.java index 89626b24a..af24126e3 100644 --- a/src/com/engine/salary/biz/SISchemeBiz.java +++ b/src/com/engine/salary/biz/SISchemeBiz.java @@ -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 insuranceSchemeDetailDTOList = getSchemeDetailFormDTO(welfareTypeEnum,id); + return InsuranceSchemeFormVO.builder().schemeBatch(insuranceSchemeDTO).schemeDetailList(insuranceSchemeDetailDTOList).build(); + } + + /** + * 获取方案明细表集合 新建|详情 + * + * @param welfareTypeEnum 福利类型 + * @param id 方案主键id + * @return form + */ + private List getSchemeDetailFormDTO(WelfareTypeEnum welfareTypeEnum, Long id) { + List insuranceCategoryPOS = listByWelfareType(welfareTypeEnum.getValue()); + List 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 insuranceSchemeDetailPOS = listByPrimaryId(id); - List insuranceSchemeDetailDTOS = new ArrayList<>(); - BeanUtils.copyProperties(insuranceSchemeDetailPOS,insuranceSchemeDetailDTOS); - return InsuranceSchemeFormVO.builder().schemeBatch(insuranceSchemeDTO).schemeDetailList(insuranceSchemeDetailDTOS).build(); + private List listByWelfareType(Integer welfareType) { + SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession(); + try { + ICategoryMapper iCategoryMapper = sqlSession.getMapper(ICategoryMapper.class); + List 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; } /** diff --git a/src/com/engine/salary/cmd/archives/SIArchivesGetBaseFormCmd.java b/src/com/engine/salary/cmd/archives/SIArchivesGetBaseFormCmd.java new file mode 100644 index 000000000..7474113dd --- /dev/null +++ b/src/com/engine/salary/cmd/archives/SIArchivesGetBaseFormCmd.java @@ -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> { + + + public SIArchivesGetBaseFormCmd(Map params, User user) { + this.user = user; + this.params = params; + } + + @Override + public BizLogContext getLogContext() { + return null; + } + + @Override + public Map execute(CommandContext commandContext) { + Map 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 items = new HashMap<>(); + + + return apidatas; + } +} diff --git a/src/com/engine/salary/cmd/archives/SIArchivesTipsCmd.java b/src/com/engine/salary/cmd/archives/SIArchivesTipsCmd.java new file mode 100644 index 000000000..297e2919b --- /dev/null +++ b/src/com/engine/salary/cmd/archives/SIArchivesTipsCmd.java @@ -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> { + + public SIArchivesTipsCmd(Map params, User user) { + this.user = user; + this.params = params; + } + + @Override + public BizLogContext getLogContext() { + return null; + } + + @Override + public Map execute(CommandContext commandContext) { + + return null; + } +} diff --git a/src/com/engine/salary/cmd/sischeme/SISchemeGetFormCmd.java b/src/com/engine/salary/cmd/sischeme/SISchemeGetFormCmd.java index 1ed8c8a0c..8d0ee47fa 100644 --- a/src/com/engine/salary/cmd/sischeme/SISchemeGetFormCmd.java +++ b/src/com/engine/salary/cmd/sischeme/SISchemeGetFormCmd.java @@ -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 execute(CommandContext commandContext) { Map 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; } diff --git a/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesFundSchemePO.java b/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesFundSchemePO.java new file mode 100644 index 000000000..50d300f2b --- /dev/null +++ b/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesFundSchemePO.java @@ -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; +} diff --git a/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesOtherSchemePO.java b/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesOtherSchemePO.java new file mode 100644 index 000000000..8461da578 --- /dev/null +++ b/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesOtherSchemePO.java @@ -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; +} diff --git a/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesSocialSchemePO.java b/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesSocialSchemePO.java new file mode 100644 index 000000000..0a8a609f7 --- /dev/null +++ b/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesSocialSchemePO.java @@ -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; +} diff --git a/src/com/engine/salary/init.sql b/src/com/engine/salary/init.sql index 6b4643b34..7e49ea3cc 100644 --- a/src/com/engine/salary/init.sql +++ b/src/com/engine/salary/init.sql @@ -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; + + + diff --git a/src/com/engine/salary/mapper/sicategory/ICategoryMapper.java b/src/com/engine/salary/mapper/sicategory/ICategoryMapper.java index f8925d7a3..3e2128ba5 100644 --- a/src/com/engine/salary/mapper/sicategory/ICategoryMapper.java +++ b/src/com/engine/salary/mapper/sicategory/ICategoryMapper.java @@ -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 listByWelfareType(@Param("welfareType") Integer welfareType); } diff --git a/src/com/engine/salary/mapper/sicategory/ICategoryMapper.xml b/src/com/engine/salary/mapper/sicategory/ICategoryMapper.xml index 22a636afc..7a653349b 100644 --- a/src/com/engine/salary/mapper/sicategory/ICategoryMapper.xml +++ b/src/com/engine/salary/mapper/sicategory/ICategoryMapper.xml @@ -39,6 +39,8 @@ WHERE id = #{id} AND delete_type = 0 + + + + UPDATE hrsa_insurance_category diff --git a/src/com/engine/salary/mapper/sischeme/InsuranceSchemeDetailMapper.java b/src/com/engine/salary/mapper/sischeme/InsuranceSchemeDetailMapper.java index 5a73c1a95..35f9b9f84 100644 --- a/src/com/engine/salary/mapper/sischeme/InsuranceSchemeDetailMapper.java +++ b/src/com/engine/salary/mapper/sischeme/InsuranceSchemeDetailMapper.java @@ -45,4 +45,7 @@ public interface InsuranceSchemeDetailMapper { */ List queryListByInsuranceIdIsPayment(@Param("insuranceId") Long insuranceId, @Param("isPayment") Integer isPayment); + + InsuranceSchemeDetailPO getByPPI(@Param("primaryId") Long primaryId, @Param("paymentScope") Integer paymentScope, + @Param("insuranceId") Long insuranceId); } diff --git a/src/com/engine/salary/mapper/sischeme/InsuranceSchemeDetailMapper.xml b/src/com/engine/salary/mapper/sischeme/InsuranceSchemeDetailMapper.xml index 39eacba28..24eb7ac25 100644 --- a/src/com/engine/salary/mapper/sischeme/InsuranceSchemeDetailMapper.xml +++ b/src/com/engine/salary/mapper/sischeme/InsuranceSchemeDetailMapper.xml @@ -45,6 +45,26 @@ + + 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 + + + + + + + + AND primary_id = #{primaryId} + + + + + listByName(String schemeName); + + } diff --git a/src/com/engine/salary/service/SIArchivesService.java b/src/com/engine/salary/service/SIArchivesService.java new file mode 100644 index 000000000..7bfa31c20 --- /dev/null +++ b/src/com/engine/salary/service/SIArchivesService.java @@ -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 getTips(Map params); + + Map getBaseForm(Map params); +} diff --git a/src/com/engine/salary/service/impl/SIArchivesServiceImpl.java b/src/com/engine/salary/service/impl/SIArchivesServiceImpl.java new file mode 100644 index 000000000..fc01cbd8a --- /dev/null +++ b/src/com/engine/salary/service/impl/SIArchivesServiceImpl.java @@ -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 getTips(Map params) { + return commandExecutor.execute(new SIArchivesTipsCmd(params,user)); + } + + @Override + public Map getBaseForm(Map params) { + return null; + } +} diff --git a/src/com/engine/salary/web/SIArchivesController.java b/src/com/engine/salary/web/SIArchivesController.java new file mode 100644 index 000000000..13c772e80 --- /dev/null +++ b/src/com/engine/salary/web/SIArchivesController.java @@ -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 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)); + } + + + +} diff --git a/src/com/engine/salary/web/SICategoryController.java b/src/com/engine/salary/web/SICategoryController.java index 631eb1283..6692f4b52 100644 --- a/src/com/engine/salary/web/SICategoryController.java +++ b/src/com/engine/salary/web/SICategoryController.java @@ -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; diff --git a/src/com/engine/salary/web/SISchemeController.java b/src/com/engine/salary/web/SISchemeController.java index 2797179f3..ae8f525a5 100644 --- a/src/com/engine/salary/web/SISchemeController.java +++ b/src/com/engine/salary/web/SISchemeController.java @@ -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 map = ParamUtil.request2Map(request); + //InsuranceSchemeDTO insuranceSchemeDTO = InsuranceSchemeDTO.builder().welfareType(welfareTypeEnum).build(); + map.put("welfareTypeEnum",welfareTypeEnum); + return ResponseResult.run(getService(user)::getForm, map); }