福利模块insert getForm delete update copy接口
This commit is contained in:
parent
2b61b030d7
commit
91958201e5
|
|
@ -1,16 +1,28 @@
|
|||
package com.engine.salary.biz;
|
||||
|
||||
import com.engine.salary.constant.SalaryDefaultTenantConstant;
|
||||
import com.engine.salary.entity.sischeme.bo.InsuranceSchemeBO;
|
||||
import com.engine.salary.entity.sischeme.dto.InsuranceSchemeDTO;
|
||||
import com.engine.salary.entity.sischeme.dto.InsuranceSchemeDetailDTO;
|
||||
import com.engine.salary.entity.sischeme.param.InsuranceSchemeReqParam;
|
||||
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.exception.SalaryRunTimeException;
|
||||
import com.engine.salary.mapper.sischeme.InsuranceSchemeDetailMapper;
|
||||
import com.engine.salary.mapper.sischeme.InsuranceSchemeMapper;
|
||||
import com.engine.salary.util.PoToDtoUtil;
|
||||
import com.mzlion.core.utils.BeanUtils;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.ibatis.session.SqlSession;
|
||||
import weaver.conn.mybatis.MyBatisFactory;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
/**
|
||||
* @Author weaver_cl
|
||||
|
|
@ -29,29 +41,27 @@ public class SISchemeBiz {
|
|||
*/
|
||||
public InsuranceSchemeFormVO getForm(Long id, WelfareTypeEnum welfareType) {
|
||||
|
||||
try {
|
||||
if (id != null) {
|
||||
//查询社保方案基础信息表单
|
||||
InsuranceSchemePO insuranceSchemePO = getById(id);
|
||||
InsuranceSchemeDTO insuranceSchemeDTO = new InsuranceSchemeDTO();
|
||||
insuranceSchemeDTO = (InsuranceSchemeDTO)PoToDtoUtil.poToDto(insuranceSchemePO,insuranceSchemeDTO);
|
||||
return InsuranceSchemeFormVO.builder().schemeBatch(insuranceSchemeDTO).build();
|
||||
}
|
||||
|
||||
}catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
if (id != null) {
|
||||
//查询社保方案基础信息主表(enum问题处理)
|
||||
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();
|
||||
}
|
||||
|
||||
return InsuranceSchemeFormVO.builder().build();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*社保方案基础信息主表
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
private InsuranceSchemePO getById(Long id) {
|
||||
public InsuranceSchemePO getById(Long id) {
|
||||
|
||||
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
|
||||
try {
|
||||
|
|
@ -63,4 +73,167 @@ public class SISchemeBiz {
|
|||
sqlSession.close();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 社保方案基础信息明细表
|
||||
* @param primaryId
|
||||
* @return
|
||||
*/
|
||||
public List<InsuranceSchemeDetailPO> listByPrimaryId(Long primaryId) {
|
||||
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
|
||||
try {
|
||||
InsuranceSchemeDetailMapper insuranceSchemeDetailMapper = sqlSession.getMapper(InsuranceSchemeDetailMapper.class);
|
||||
return insuranceSchemeDetailMapper.listByPrimaryId(primaryId);
|
||||
|
||||
} finally {
|
||||
sqlSession.close();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增
|
||||
* @param saveParam
|
||||
* @param employeeId
|
||||
*/
|
||||
public void save(InsuranceSchemeReqParam saveParam, long employeeId) {
|
||||
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
|
||||
|
||||
try{
|
||||
//保存福利项目主表
|
||||
InsuranceSchemeMapper insuranceSchemeMapper = sqlSession.getMapper(InsuranceSchemeMapper.class);
|
||||
InsuranceSchemePO insuranceSchemePO = InsuranceSchemeBO.convert2BatchPO(saveParam.getInsuranceScheme(), employeeId);
|
||||
insuranceSchemeMapper.insert(insuranceSchemePO);
|
||||
//日志
|
||||
|
||||
//保存福利项目明细表
|
||||
InsuranceSchemeDetailMapper insuranceSchemeDetailMapper = sqlSession.getMapper(InsuranceSchemeDetailMapper.class);
|
||||
List<InsuranceSchemeDetailPO> insuranceSchemeDetailPOS = InsuranceSchemeBO.convertToInsuranceSchemeDetailPoList(saveParam.getInsuranceSchemeDetailList(),employeeId,insuranceSchemePO.getId());
|
||||
insuranceSchemeDetailPOS.forEach(insuranceSchemeDetailMapper::insert);
|
||||
|
||||
sqlSession.commit();
|
||||
|
||||
} finally {
|
||||
sqlSession.close();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新
|
||||
* @param updateParam
|
||||
* @param employeeId
|
||||
*/
|
||||
public void update(InsuranceSchemeReqParam updateParam, long employeeId) {
|
||||
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
|
||||
try {
|
||||
InsuranceSchemeMapper insuranceSchemeMapper = sqlSession.getMapper(InsuranceSchemeMapper.class);
|
||||
InsuranceSchemeDetailMapper insuranceSchemeDetailMapper = sqlSession.getMapper(InsuranceSchemeDetailMapper.class);
|
||||
|
||||
//查询是否存在福利方案
|
||||
InsuranceSchemePO insuranceSchemePO = getById(updateParam.getInsuranceScheme().getId());
|
||||
if (Objects.isNull(insuranceSchemePO)) {
|
||||
throw new SalaryRunTimeException("福利方案不存在");
|
||||
}
|
||||
|
||||
//福利方案名称重复(待写)
|
||||
|
||||
//更新福利方案主表
|
||||
InsuranceSchemePO insuranceSchemePO1 = InsuranceSchemeBO.buildInsuranceSchemePO(insuranceSchemePO, updateParam.getInsuranceScheme());
|
||||
insuranceSchemeMapper.update(insuranceSchemePO1);
|
||||
|
||||
//更新福利方案明细表 先删后插
|
||||
insuranceSchemeDetailMapper.batchDeleteByPrimaryIds(Collections.singleton(updateParam.getInsuranceScheme().getId()));
|
||||
//更新明细表
|
||||
List<InsuranceSchemeDetailPO> insuranceSchemeDetailPOS = InsuranceSchemeBO.convertToInsuranceSchemeDetailPoList(updateParam.getInsuranceSchemeDetailList(), employeeId, insuranceSchemePO.getId());
|
||||
insuranceSchemeDetailPOS.forEach(insuranceSchemeDetailMapper::insert);
|
||||
|
||||
//记录操作日志
|
||||
|
||||
sqlSession.commit();
|
||||
}finally {
|
||||
sqlSession.close();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 复制方案
|
||||
* @param id
|
||||
* @param schemeName
|
||||
* @param employeeId
|
||||
*/
|
||||
public void copy(Long id, String schemeName, long employeeId) {
|
||||
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
|
||||
try {
|
||||
InsuranceSchemeMapper insuranceSchemeMapper = sqlSession.getMapper(InsuranceSchemeMapper.class);
|
||||
InsuranceSchemeDetailMapper insuranceSchemeDetailMapper = sqlSession.getMapper(InsuranceSchemeDetailMapper.class);
|
||||
if (Objects.isNull(id)) {
|
||||
throw new SalaryRunTimeException("方案id为空");
|
||||
}
|
||||
|
||||
if(Objects.isNull(schemeName)) {
|
||||
throw new SalaryRunTimeException("复制方案名为空");
|
||||
}
|
||||
|
||||
InsuranceSchemePO insuranceSchemePO = getById(id);
|
||||
if (Objects.isNull(insuranceSchemePO)) {
|
||||
throw new SalaryRunTimeException("方案不存在");
|
||||
}
|
||||
|
||||
if (insuranceSchemePO.getSchemeName().equals(schemeName)) {
|
||||
throw new SalaryRunTimeException("方案名称重复");
|
||||
}
|
||||
|
||||
InsuranceSchemePO batchPO = InsuranceSchemePO.builder()
|
||||
//.id(IdGenerator.generate())
|
||||
.creator(employeeId)
|
||||
.createTime(new Date())
|
||||
.tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY)
|
||||
.schemeName(schemeName)
|
||||
.paymentArea(insuranceSchemePO.getPaymentArea())
|
||||
.updateTime(new Date())
|
||||
.deleteType(DeleteTypeEnum.NOT_DELETED.getValue())
|
||||
.paymentType(insuranceSchemePO.getPaymentType())
|
||||
.remarks(insuranceSchemePO.getRemarks())
|
||||
.welfareType(insuranceSchemePO.getWelfareType())
|
||||
.isUse(insuranceSchemePO.getIsUse())
|
||||
.build();
|
||||
insuranceSchemeMapper.insert(batchPO);
|
||||
|
||||
List<InsuranceSchemeDetailPO> detailList = insuranceSchemeDetailMapper.listByPrimaryId(batchPO.getId());
|
||||
if (CollectionUtils.isNotEmpty(detailList)) {
|
||||
List<InsuranceSchemeDetailPO> detailPOS = detailList.stream().map(item -> InsuranceSchemeDetailPO.builder()
|
||||
//.id(IdGenerator.generate())
|
||||
.creator(employeeId)
|
||||
.createTime(new Date())
|
||||
.deleteType(DeleteTypeEnum.NOT_DELETED.getValue())
|
||||
.effectiveTime(item.getEffectiveTime())
|
||||
.expirationTime(item.getExpirationTime())
|
||||
.fixedCost(item.getFixedCost())
|
||||
.insuranceId(item.getInsuranceId())
|
||||
.isPayment(item.getIsPayment())
|
||||
.lowerLimit(item.getLowerLimit())
|
||||
.paymentScope(item.getPaymentScope())
|
||||
.tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY)
|
||||
.paymentProportion(item.getPaymentProportion())
|
||||
.updateTime(new Date())
|
||||
.primaryId(batchPO.getId())
|
||||
.rententionRule(item.getRententionRule())
|
||||
.upperLimit(item.getUpperLimit())
|
||||
.validNum(item.getValidNum())
|
||||
.build()
|
||||
).collect(Collectors.toList());
|
||||
|
||||
detailPOS.forEach(insuranceSchemeDetailMapper::insert);
|
||||
}
|
||||
|
||||
|
||||
|
||||
sqlSession.commit();
|
||||
}finally {
|
||||
sqlSession.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,39 @@
|
|||
package com.engine.salary.cmd.sischeme;
|
||||
|
||||
import com.engine.common.biz.AbstractCommonCommand;
|
||||
import com.engine.common.entity.BizLogContext;
|
||||
import com.engine.core.interceptor.CommandContext;
|
||||
import com.engine.salary.biz.SISchemeBiz;
|
||||
import weaver.general.Util;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author weaver_cl
|
||||
* @Description: TODO
|
||||
* @Date 2022/3/8
|
||||
* @Version V1.0
|
||||
**/
|
||||
public class SISchemeCopyCmd extends AbstractCommonCommand<Map<String, Object>> {
|
||||
|
||||
public SISchemeCopyCmd(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<String, Object>(16);
|
||||
SISchemeBiz siSchemeBiz = new SISchemeBiz();
|
||||
Long id = (Long) params.get("id");
|
||||
String schemeName = Util.null2String(params.get("schemeName"));
|
||||
siSchemeBiz.copy(id,schemeName,(long) user.getUID());
|
||||
return apidatas;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
package com.engine.salary.cmd.sischeme;
|
||||
|
||||
import com.engine.common.biz.AbstractCommonCommand;
|
||||
import com.engine.common.entity.BizLogContext;
|
||||
import com.engine.core.interceptor.CommandContext;
|
||||
import com.engine.salary.biz.SISchemeBiz;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author weaver_cl
|
||||
* @Description: TODO
|
||||
* @Date 2022/3/8
|
||||
* @Version V1.0
|
||||
**/
|
||||
public class SISchemeDeleteCmd extends AbstractCommonCommand<Map<String, Object>> {
|
||||
|
||||
public SISchemeDeleteCmd(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<String, Object>(16);
|
||||
|
||||
|
||||
Collection<Long> ids = (Collection<Long>)params.get("ids");
|
||||
if (CollectionUtils.isEmpty(ids)) {
|
||||
throw new SalaryRunTimeException("参数错误");
|
||||
}
|
||||
SISchemeBiz siSchemeBiz = new SISchemeBiz();
|
||||
|
||||
return apidatas;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
package com.engine.salary.cmd.sischeme;
|
||||
|
||||
import com.engine.common.biz.AbstractCommonCommand;
|
||||
import com.engine.common.entity.BizLogContext;
|
||||
import com.engine.core.interceptor.CommandContext;
|
||||
import com.engine.salary.biz.SISchemeBiz;
|
||||
import com.engine.salary.entity.sischeme.param.InsuranceSchemeReqParam;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author weaver_cl
|
||||
* @Description: TODO
|
||||
* @Date 2022/3/8
|
||||
* @Version V1.0
|
||||
**/
|
||||
public class SISchemeInsertCmd extends AbstractCommonCommand<Map<String, Object>> {
|
||||
|
||||
public SISchemeInsertCmd(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<String, Object>(16);
|
||||
SISchemeBiz siSchemeBiz = new SISchemeBiz();
|
||||
InsuranceSchemeReqParam insuranceSchemeReqParam = (InsuranceSchemeReqParam) params.get("insuranceSchemeReqParam");
|
||||
siSchemeBiz.save(insuranceSchemeReqParam, (long) user.getUID());
|
||||
return apidatas;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
package com.engine.salary.cmd.sischeme;
|
||||
|
||||
import com.engine.common.biz.AbstractCommonCommand;
|
||||
import com.engine.common.entity.BizLogContext;
|
||||
import com.engine.core.interceptor.CommandContext;
|
||||
import com.engine.salary.biz.SISchemeBiz;
|
||||
import com.engine.salary.entity.sischeme.param.InsuranceSchemeReqParam;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author weaver_cl
|
||||
* @Description: TODO
|
||||
* @Date 2022/3/8
|
||||
* @Version V1.0
|
||||
**/
|
||||
public class SISchemeUpdateCmd extends AbstractCommonCommand<Map<String, Object>> {
|
||||
|
||||
public SISchemeUpdateCmd(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<String, Object>(16);
|
||||
SISchemeBiz siSchemeBiz = new SISchemeBiz();
|
||||
InsuranceSchemeReqParam insuranceSchemeReqParam = (InsuranceSchemeReqParam) params.get("insuranceSchemeReqParam");
|
||||
siSchemeBiz.update(insuranceSchemeReqParam, (long) user.getUID());
|
||||
return apidatas;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,91 @@
|
|||
package com.engine.salary.entity.sischeme.bo;
|
||||
|
||||
import com.engine.salary.constant.SalaryDefaultTenantConstant;
|
||||
import com.engine.salary.entity.sischeme.dto.InsuranceSchemeDTO;
|
||||
import com.engine.salary.entity.sischeme.dto.InsuranceSchemeDetailDTO;
|
||||
import com.engine.salary.entity.sischeme.po.InsuranceSchemeDetailPO;
|
||||
import com.engine.salary.entity.sischeme.po.InsuranceSchemePO;
|
||||
import com.engine.salary.enums.sicategory.DeleteTypeEnum;
|
||||
import com.engine.salary.enums.sicategory.IsPaymentEnum;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Author weaver_cl
|
||||
* @Description: TODO 福利方案业务方法
|
||||
* @Date 2022/3/8
|
||||
* @Version V1.0
|
||||
**/
|
||||
public class InsuranceSchemeBO {
|
||||
|
||||
private InsuranceSchemeBO() {
|
||||
throw new SalaryRunTimeException("该类不需要创建实例");
|
||||
}
|
||||
|
||||
|
||||
public static InsuranceSchemePO convert2BatchPO(InsuranceSchemeDTO dto, Long employeeId) {
|
||||
if (Objects.isNull(dto)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return InsuranceSchemePO.builder()
|
||||
//.id(IdGenerator.generate())
|
||||
.schemeName(dto.getSchemeName())
|
||||
.paymentType(dto.getPaymentType().getValue())
|
||||
.welfareType(dto.getWelfareType().getValue())
|
||||
.isUse(1)
|
||||
.paymentArea(dto.getPaymentArea())
|
||||
.remarks(dto.getRemarks())
|
||||
.creator(employeeId)
|
||||
.tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY)
|
||||
.createTime(new Date())
|
||||
.updateTime(new Date())
|
||||
.deleteType(0)
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
public static List<InsuranceSchemeDetailPO> convertToInsuranceSchemeDetailPoList(List<InsuranceSchemeDetailDTO> list, long employeeId,Long primaryId) {
|
||||
if (CollectionUtils.isEmpty(list)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return list.stream().map(item -> InsuranceSchemeDetailPO.builder()
|
||||
//.id(IdGenerator.generate())
|
||||
.insuranceId(item.getInsuranceId())
|
||||
.primaryId(primaryId)
|
||||
.createTime(new Date())
|
||||
.creator(employeeId)
|
||||
.deleteType(DeleteTypeEnum.NOT_DELETED.getValue())
|
||||
.effectiveTime(item.getEffectiveTime())
|
||||
.expirationTime(item.getExpirationTime())
|
||||
.fixedCost(item.getFixedCost() != null ? item.getFixedCost().toString() : "0.000")
|
||||
.isPayment(item.getIsPayment() ? IsPaymentEnum.YES.getValue() : IsPaymentEnum.NO.getValue())
|
||||
.lowerLimit(item.getLowerLimit() != null ? item.getLowerLimit().toString() : "0.000")
|
||||
.paymentScope(item.getPaymentScopeValue())
|
||||
.tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY)
|
||||
.upperLimit(item.getUpperLimit() != null ? item.getUpperLimit().toString() : "0.000")
|
||||
.paymentProportion(item.getPaymentProportion() != null ? item.getPaymentProportion().toString() : "0.0000")
|
||||
.rententionRule(item.getRententionRule() != null ? Integer.valueOf(item.getRententionRule()) : null)
|
||||
.updateTime(new Date())
|
||||
.validNum(item.getValidNum())
|
||||
.build()
|
||||
).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
public static InsuranceSchemePO buildInsuranceSchemePO(InsuranceSchemePO po, InsuranceSchemeDTO dto) {
|
||||
po.setUpdateTime(new Date());
|
||||
po.setPaymentArea(dto.getPaymentArea());
|
||||
po.setPaymentType(dto.getPaymentType().getValue());
|
||||
po.setSchemeName(dto.getSchemeName());
|
||||
po.setRemarks(dto.getRemarks());
|
||||
return po;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
package com.engine.salary.entity.sischeme.param;
|
||||
|
||||
import com.engine.salary.entity.sischeme.dto.InsuranceSchemeDTO;
|
||||
import com.engine.salary.entity.sischeme.dto.InsuranceSchemeDetailDTO;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* @Author weaver_cl
|
||||
* @Description: TODO 福利方案DTO
|
||||
* @Date 2022/3/8
|
||||
* @Version V1.0
|
||||
**/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class InsuranceSchemeReqParam {
|
||||
|
||||
private Boolean isMobile;
|
||||
|
||||
/**
|
||||
* 福利方案基本信息
|
||||
*/
|
||||
private InsuranceSchemeDTO insuranceScheme;
|
||||
|
||||
/**
|
||||
* 福利方案明细
|
||||
*/
|
||||
private List<InsuranceSchemeDetailDTO> insuranceSchemeDetailList;
|
||||
}
|
||||
|
|
@ -0,0 +1,113 @@
|
|||
package com.engine.salary.entity.sischeme.po;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
/**
|
||||
* @Author weaver_cl
|
||||
* @Description: TODO hrsa_scheme_detail 社保方案明细主表
|
||||
* @Date 2022/3/8
|
||||
* @Version V1.0
|
||||
**/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class InsuranceSchemeDetailPO {
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 社保方案主表id
|
||||
*/
|
||||
private Long primaryId;
|
||||
|
||||
/**
|
||||
* 险种id
|
||||
*/
|
||||
private Long insuranceId;
|
||||
|
||||
/**
|
||||
* 生效年月(含)
|
||||
*/
|
||||
private String effectiveTime;
|
||||
|
||||
/**
|
||||
* 失效年月(不含)
|
||||
*/
|
||||
private String expirationTime;
|
||||
|
||||
/**
|
||||
* 是否缴费 0-否 1-是
|
||||
*/
|
||||
private Integer isPayment;
|
||||
|
||||
/**
|
||||
* 缴纳对象
|
||||
*/
|
||||
private Integer paymentScope;
|
||||
|
||||
/**
|
||||
* 基数上限
|
||||
*/
|
||||
private String upperLimit;
|
||||
|
||||
/**
|
||||
* 基数下限
|
||||
*/
|
||||
private String lowerLimit;
|
||||
|
||||
/**
|
||||
* 缴纳比例
|
||||
*/
|
||||
private String paymentProportion;
|
||||
|
||||
/**
|
||||
* 固定费用
|
||||
*/
|
||||
private String fixedCost;
|
||||
|
||||
/**
|
||||
* 有效小数位
|
||||
*/
|
||||
private Integer validNum;
|
||||
|
||||
/**
|
||||
* 进位规则
|
||||
*/
|
||||
private Integer rententionRule;
|
||||
|
||||
/**
|
||||
* 创建人id
|
||||
*/
|
||||
private Long creator;
|
||||
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
private Integer deleteType;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 租户key
|
||||
*/
|
||||
private String tenantKey;
|
||||
}
|
||||
|
||||
|
|
@ -5,7 +5,8 @@ import lombok.Builder;
|
|||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
/**
|
||||
* @Author weaver_cl
|
||||
|
|
@ -67,12 +68,12 @@ public class InsuranceSchemePO {
|
|||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private LocalDateTime createTime;
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private LocalDateTime updateTime;
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 租户key
|
||||
|
|
|
|||
|
|
@ -2,3 +2,8 @@
|
|||
alter table hrsa_tax_agent modify id bigint auto_increment;
|
||||
alter table hrsa_tax_rate_base modify id bigint auto_increment;
|
||||
alter table hrsa_tax_rate_detail modify id bigint auto_increment;
|
||||
|
||||
|
||||
--福利方案主键自增
|
||||
alter table hrsa_social_security_scheme modify id bigint auto_increment;
|
||||
alter table hrsa_scheme_detail modify id bigint auto_increment;
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
package com.engine.salary.mapper.sischeme;
|
||||
|
||||
import com.engine.salary.entity.sischeme.po.InsuranceSchemeDetailPO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author weaver_cl
|
||||
* @Description: TODO
|
||||
* @Date 2022/3/8
|
||||
* @Version V1.0
|
||||
**/
|
||||
public interface InsuranceSchemeDetailMapper {
|
||||
|
||||
|
||||
List<InsuranceSchemeDetailPO> listByPrimaryId(Long primaryId);
|
||||
|
||||
/**
|
||||
* 新增,插入所有字段
|
||||
*
|
||||
* @param insuranceSchemeDetailPO 新增的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int insert(InsuranceSchemeDetailPO insuranceSchemeDetailPO);
|
||||
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
* @param primaryIds
|
||||
*/
|
||||
void batchDeleteByPrimaryIds(@Param("primaryIds") Collection<Long> primaryIds);
|
||||
}
|
||||
|
|
@ -0,0 +1,115 @@
|
|||
<?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.sischeme.InsuranceSchemeDetailMapper">
|
||||
<resultMap id="BaseResultMap" type="com.engine.salary.entity.sischeme.po.InsuranceSchemeDetailPO">
|
||||
<result column="id" property="id"/>
|
||||
<result column="primary_id" property="primaryId"/>
|
||||
<result column="insurance_id" property="insuranceId"/>
|
||||
<result column="effective_time" property="effectiveTime"/>
|
||||
<result column="expiration_time" property="expirationTime"/>
|
||||
<result column="is_payment" property="isPayment"/>
|
||||
<result column="payment_scope" property="paymentScope"/>
|
||||
<result column="upper_limit" property="upperLimit"/>
|
||||
<result column="lower_limit" property="lowerLimit"/>
|
||||
<result column="payment_proportion" property="paymentProportion"/>
|
||||
<result column="fixed_cost" property="fixedCost"/>
|
||||
<result column="valid_num" property="validNum"/>
|
||||
<result column="rentention_rule" property="rententionRule"/>
|
||||
<result column="create_time" property="createTime"/>
|
||||
<result column="update_time" property="updateTime"/>
|
||||
<result column="creator" property="creator"/>
|
||||
<result column="delete_type" property="deleteType"/>
|
||||
<result column="tenant_key" property="tenantKey"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 表字段 -->
|
||||
<sql id="baseColumns">
|
||||
t.id
|
||||
, t.primary_id
|
||||
, t.insurance_id
|
||||
, t.effective_time
|
||||
, t.expiration_time
|
||||
, t.is_payment
|
||||
, t.payment_scope
|
||||
, t.upper_limit
|
||||
, t.lower_limit
|
||||
, 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
|
||||
<include refid="baseColumns"/>
|
||||
FROM hrsa_scheme_detail t
|
||||
WHERE 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"
|
||||
>
|
||||
INSERT INTO hrsa_scheme_detail
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
id,
|
||||
primary_id,
|
||||
insurance_id,
|
||||
effective_time,
|
||||
expiration_time,
|
||||
is_payment,
|
||||
payment_scope,
|
||||
upper_limit,
|
||||
lower_limit,
|
||||
payment_proportion,
|
||||
fixed_cost,
|
||||
valid_num,
|
||||
rentention_rule,
|
||||
create_time,
|
||||
update_time,
|
||||
creator,
|
||||
delete_type,
|
||||
tenant_key,
|
||||
</trim>
|
||||
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
||||
#{id},
|
||||
#{primaryId},
|
||||
#{insuranceId},
|
||||
#{effectiveTime},
|
||||
#{expirationTime},
|
||||
#{isPayment},
|
||||
#{paymentScope},
|
||||
#{upperLimit},
|
||||
#{lowerLimit},
|
||||
#{paymentProportion},
|
||||
#{fixedCost},
|
||||
#{validNum},
|
||||
#{rententionRule},
|
||||
#{createTime},
|
||||
#{updateTime},
|
||||
#{creator},
|
||||
#{deleteType},
|
||||
#{tenantKey},
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="batchDeleteByPrimaryIds">
|
||||
UPDATE hrsa_scheme_detail
|
||||
SET delete_type = 1
|
||||
WHERE delete_type = 0
|
||||
AND base_id IN
|
||||
<foreach collection="primaryIds" open="(" item="primaryIds" separator="," close=")">
|
||||
#{primaryIds}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
|
||||
|
||||
</mapper>
|
||||
|
|
@ -10,6 +10,25 @@ import com.engine.salary.entity.sischeme.po.InsuranceSchemePO;
|
|||
**/
|
||||
public interface InsuranceSchemeMapper {
|
||||
|
||||
/**
|
||||
* 根据主键查询
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 返回记录,没有返回null
|
||||
*/
|
||||
InsuranceSchemePO getById(Long id);
|
||||
|
||||
/**
|
||||
* 新增,插入所有字段
|
||||
* @param insuranceSchemePO 新增的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int insert(InsuranceSchemePO insuranceSchemePO);
|
||||
|
||||
/**
|
||||
* 更新,更新修改的字段
|
||||
* @param insuranceSchemePO
|
||||
* @return
|
||||
*/
|
||||
int update(InsuranceSchemePO insuranceSchemePO);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
<result column="id" property="id"/>
|
||||
<result column="payment_area" property="paymentArea"/>
|
||||
<result column="payment_type" property="paymentType"/>
|
||||
<result column="schemeName" property="schemeName"/>
|
||||
<result column="scheme_name" property="schemeName"/>
|
||||
<result column="welfare_type" property="welfareType"/>
|
||||
<result column="is_use" property="isUse"/>
|
||||
<result column="remarks" property="remarks"/>
|
||||
|
|
@ -18,12 +18,10 @@
|
|||
|
||||
<!-- 表字段 -->
|
||||
<sql id="baseColumns">
|
||||
t
|
||||
.
|
||||
id
|
||||
t.id
|
||||
, t.payment_area
|
||||
, t.payment_type
|
||||
, t.schemeName
|
||||
, t.scheme_name
|
||||
, t.welfare_type
|
||||
, t.is_use
|
||||
, t.remarks
|
||||
|
|
@ -43,5 +41,53 @@
|
|||
WHERE id = #{id} AND delete_type = 0
|
||||
</select>
|
||||
|
||||
<!-- 插入全部字段 -->
|
||||
<insert id="insert" parameterType="com.engine.salary.entity.sischeme.po.InsuranceSchemePO"
|
||||
keyProperty="id" keyColumn="id" useGeneratedKeys="true"
|
||||
>
|
||||
INSERT INTO hrsa_social_security_scheme
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
id,
|
||||
payment_area,
|
||||
payment_type,
|
||||
scheme_name,
|
||||
welfare_type,
|
||||
is_use,
|
||||
remarks,
|
||||
create_time,
|
||||
update_time,
|
||||
creator,
|
||||
delete_type,
|
||||
tenant_key,
|
||||
</trim>
|
||||
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
||||
#{id},
|
||||
#{paymentArea},
|
||||
#{paymentType},
|
||||
#{schemeName},
|
||||
#{welfareType},
|
||||
#{isUse},
|
||||
#{remarks},
|
||||
#{createTime},
|
||||
#{updateTime},
|
||||
#{creator},
|
||||
#{deleteType},
|
||||
#{tenantKey},
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<!-- 更新,更新修改字段 -->
|
||||
<update id="update" parameterType="com.engine.salary.entity.sischeme.po.InsuranceSchemePO">
|
||||
UPDATE hrsa_social_security_scheme
|
||||
<set>
|
||||
update_time=#{updateTime},
|
||||
payment_area=#{paymentArea},
|
||||
payment_type=#{paymentType},
|
||||
scheme_name=#{schemeName},
|
||||
remarks=#{remarks},
|
||||
</set>
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</update>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
|
@ -11,4 +11,12 @@ import java.util.Map;
|
|||
public interface SISchemeService {
|
||||
|
||||
Map<String, Object> getForm(Map<String, Object> params);
|
||||
|
||||
Map<String, Object> insertScheme(Map<String, Object> params);
|
||||
|
||||
Map<String, Object> update(Map<String, Object> params);
|
||||
|
||||
Map<String, Object> delete(Map<String, Object> params);
|
||||
|
||||
Map<String, Object> copyScheme(Map<String, Object> params);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
package com.engine.salary.service.impl;
|
||||
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.cmd.sischeme.SISchemeGetFormCmd;
|
||||
import com.engine.salary.cmd.sischeme.*;
|
||||
import com.engine.salary.service.SISchemeService;
|
||||
|
||||
import java.util.Map;
|
||||
|
|
@ -18,4 +18,24 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
|
|||
public Map<String, Object> getForm(Map<String, Object> params) {
|
||||
return commandExecutor.execute(new SISchemeGetFormCmd(params,user));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> insertScheme(Map<String, Object> params) {
|
||||
return commandExecutor.execute(new SISchemeInsertCmd(params,user));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> update(Map<String, Object> params) {
|
||||
return commandExecutor.execute(new SISchemeUpdateCmd(params,user));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> delete(Map<String, Object> params) {
|
||||
return commandExecutor.execute(new SISchemeDeleteCmd(params,user));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> copyScheme(Map<String, Object> params) {
|
||||
return commandExecutor.execute(new SISchemeCopyCmd(params,user));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,80 +0,0 @@
|
|||
package com.engine.salary.util;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* @Author weaver_cl
|
||||
* @Description: TODO
|
||||
* @Date 2022/3/7
|
||||
* @Version V1.0
|
||||
**/
|
||||
public class PoToDtoUtil {
|
||||
/**
|
||||
* 将po对象的属性值赋值给dto对象相同属性名的属性
|
||||
* 此方法能将第一个转第二个无论是否DTO
|
||||
* @param po 赋值的对象
|
||||
* @param dto 被赋值的对象
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public static Object poToDto(Object po, Object dto) throws Exception {
|
||||
Class poClass = po.getClass();
|
||||
Class dtoClass = dto.getClass();
|
||||
// 取得po对象的所有属性
|
||||
Field[] poFields = poClass.getDeclaredFields();
|
||||
//取父类的所有属性
|
||||
Field[] superPoFields = poClass.getSuperclass().getDeclaredFields();
|
||||
//合并数组
|
||||
poFields = (Field[]) mergeArray(poFields,superPoFields);
|
||||
|
||||
// 遍历拼接dto的set方法字段表示
|
||||
for (Field f : poFields) {
|
||||
String fieldName = f.getName();
|
||||
//取得当前get,set字符串表达形式
|
||||
String dtoSetMethodName = "set" + firstToBig(fieldName);
|
||||
String poGetMethodName = "get"+firstToBig(fieldName);
|
||||
|
||||
//System.out.println(fieldName + "=====" + dtoSetMethodName);
|
||||
// 取得DTO对象的set方法
|
||||
Method dtoSetMethod=null;
|
||||
try {
|
||||
dtoSetMethod = dtoClass.getMethod(dtoSetMethodName, f.getType());
|
||||
}catch (NoSuchMethodException e) {//如果不存在此方法跳过,
|
||||
continue;
|
||||
}
|
||||
//取得Po对象的get方法
|
||||
Method poGetMethod = poClass.getMethod(poGetMethodName, null);
|
||||
// 将po对象的属性值set到dto对象中去
|
||||
dtoSetMethod.invoke(dto, poGetMethod.invoke(po, null));
|
||||
}
|
||||
return dto;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 合并数组
|
||||
* @param a
|
||||
* @param b
|
||||
* @return
|
||||
*/
|
||||
public static Object[] mergeArray(Object[] a,Object[] b) {
|
||||
Object[] c = Arrays.copyOf(a, a.length+b.length);
|
||||
System.arraycopy(b, 0, c, a.length, b.length);
|
||||
return c;
|
||||
}
|
||||
|
||||
/**
|
||||
* 首字母大写
|
||||
*
|
||||
* @param fieldName
|
||||
* @return
|
||||
*/
|
||||
public static String firstToBig(String fieldName) {
|
||||
if (fieldName != null && fieldName != "") {
|
||||
fieldName = fieldName.substring(0, 1).toUpperCase() + fieldName.substring(1);
|
||||
}
|
||||
return fieldName;
|
||||
}
|
||||
}
|
||||
|
|
@ -2,23 +2,26 @@ package com.engine.salary.web;
|
|||
|
||||
import com.engine.common.util.ParamUtil;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.salary.entity.sischeme.param.InsuranceSchemeReqParam;
|
||||
import com.engine.salary.service.SISchemeService;
|
||||
import com.engine.salary.service.impl.SISchemeServiceImpl;
|
||||
import com.engine.salary.util.ResponseResult;
|
||||
import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import weaver.hrm.HrmUserVarify;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.ws.rs.GET;
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.Produces;
|
||||
import javax.ws.rs.*;
|
||||
import javax.ws.rs.core.Context;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author weaver_cl
|
||||
* @Description: TODO
|
||||
* @Description: TODO 社保方案控制器
|
||||
* @Date 2022/3/7
|
||||
* @Version V1.0
|
||||
**/
|
||||
|
|
@ -38,8 +41,81 @@ public class SISchemeController {
|
|||
@GET
|
||||
@Path("/getForm")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String getForm(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
public String insertScheme(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return ResponseResult.run(getService(user)::getForm, ParamUtil.request2Map(request));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@POST
|
||||
@Path("/insert")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String getForm(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody InsuranceSchemeReqParam insuranceSchemeReqParam) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
Map<String, Object> map = ParamUtil.request2Map(request);
|
||||
map.put("insuranceSchemeReqParam",insuranceSchemeReqParam);
|
||||
return ResponseResult.run(getService(user)::insertScheme, map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param request
|
||||
* @param response
|
||||
* @param insuranceSchemeReqParam
|
||||
* @return
|
||||
*/
|
||||
@POST
|
||||
@Path("/update")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String update(@Context HttpServletRequest request, @Context HttpServletResponse response,@RequestBody InsuranceSchemeReqParam insuranceSchemeReqParam) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
Map<String, Object> map = ParamUtil.request2Map(request);
|
||||
map.put("insuranceSchemeReqParam",insuranceSchemeReqParam);
|
||||
return ResponseResult.run(getService(user)::update, map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除(接口中暂无)
|
||||
* @param request
|
||||
* @param response
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@POST
|
||||
@Path("/delete")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String deleteTaxRate(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody Collection<Long> ids) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
Map<String, Object> map = ParamUtil.request2Map(request);
|
||||
map.put("ids",ids);
|
||||
return ResponseResult.run(getService(user)::delete, map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 复制福利方案表单
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@GET
|
||||
@Path("/copyScheme")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String copyScheme(@Context HttpServletRequest request, @Context HttpServletResponse response,
|
||||
@QueryParam("id") Long id, @QueryParam("schemeName") String schemeName) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
Map<String, Object> map = ParamUtil.request2Map(request);
|
||||
map.put("id",id);
|
||||
map.put("schemeName",schemeName);
|
||||
return ResponseResult.run(getService(user)::copyScheme, map);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue