xzy-解决社保福利方案删除时校验问题
This commit is contained in:
parent
1969b44804
commit
4d0a73e030
|
|
@ -12,11 +12,8 @@ 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.*;
|
||||
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import com.engine.salary.mapper.siaccount.InsuranceAccountDetailMapper;
|
||||
import com.engine.salary.mapper.siaccount.SIAccountUtilMapper;
|
||||
import com.engine.salary.mapper.sicategory.ICategoryMapper;
|
||||
import com.engine.salary.mapper.sischeme.InsuranceSchemeDetailMapper;
|
||||
|
|
@ -455,8 +452,8 @@ public class SISchemeBiz {
|
|||
public int checkBeforeDeleteOtherscheme(Map<String, Object> params){
|
||||
return getSIAccountUtilMapper().checkBeforeDeleteOtherscheme((Collection<Long>)params.get("ids")).get(0).getNum();
|
||||
}
|
||||
public int checkBeforeDeleteBill(Map<String, Object> params){
|
||||
return getSIAccountUtilMapper().checkBeforeDeleteBill((Collection<Long>)params.get("ids")).get(0).getNum();
|
||||
public int checkBeforeDeleteBill(Map<String, Object> params,Integer welfareTypeId){
|
||||
return getSIAccountUtilMapper().checkBeforeDeleteBill((Collection<Long>)params.get("ids"),welfareTypeId).get(0).getNum();
|
||||
}
|
||||
|
||||
public void deleteSocialscheme(Map<String, Object> params){
|
||||
|
|
@ -465,6 +462,7 @@ public class SISchemeBiz {
|
|||
|
||||
InsuranceSchemeDetailMapper insuranceSchemeDetailMapper = sqlSession.getMapper(InsuranceSchemeDetailMapper.class);
|
||||
InsuranceSchemeMapper insuranceSchemeMapper = sqlSession.getMapper(InsuranceSchemeMapper.class);
|
||||
|
||||
insuranceSchemeMapper.deleteByIds((Collection<Long>)params.get("ids"));
|
||||
insuranceSchemeDetailMapper.deleteByIds((Collection<Long>)params.get("ids"));
|
||||
sqlSession.commit();
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ 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.enums.sicategory.WelfareTypeEnum;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import weaver.hrm.User;
|
||||
|
|
@ -41,22 +42,30 @@ public class SISchemeDeleteCmd extends AbstractCommonCommand<Map<String, Object>
|
|||
}
|
||||
SISchemeBiz siSchemeBiz = new SISchemeBiz();
|
||||
//fixme 校验带上类型
|
||||
// int num = siSchemeBiz.checkBeforeDeleteSocialscheme(params);
|
||||
// if (num > 0){
|
||||
// throw new SalaryRunTimeException("该社保方案已被使用");
|
||||
// }
|
||||
// int accumulationfundNum = siSchemeBiz.checkBeforeDeleteAccumulationfund(params);
|
||||
// if (accumulationfundNum > 0){
|
||||
// throw new SalaryRunTimeException("该公积金方案已被使用");
|
||||
// }
|
||||
// int otherschemeNum = siSchemeBiz.checkBeforeDeleteOtherscheme(params);
|
||||
// if (otherschemeNum > 0){
|
||||
// throw new SalaryRunTimeException("该其他福利方案已被使用");
|
||||
// }
|
||||
// int billNum = siSchemeBiz.checkBeforeDeleteBill(params);
|
||||
// if (billNum > 0){
|
||||
// throw new SalaryRunTimeException("该其他福利方案已被核算");
|
||||
// }
|
||||
int welfareTypeId = (Integer) params.get("welfareTypeId");
|
||||
if(WelfareTypeEnum.SOCIAL_SECURITY.getValue() == welfareTypeId){
|
||||
int num = siSchemeBiz.checkBeforeDeleteSocialscheme(params);
|
||||
if (num > 0){
|
||||
throw new SalaryRunTimeException("该社保方案已被使用");
|
||||
}
|
||||
}
|
||||
if(WelfareTypeEnum.ACCUMULATION_FUND.getValue() == welfareTypeId){
|
||||
int accumulationfundNum = siSchemeBiz.checkBeforeDeleteAccumulationfund(params);
|
||||
if (accumulationfundNum > 0){
|
||||
throw new SalaryRunTimeException("该公积金方案已被使用");
|
||||
}
|
||||
}
|
||||
if(WelfareTypeEnum.OTHER.getValue() == welfareTypeId){
|
||||
int otherschemeNum = siSchemeBiz.checkBeforeDeleteOtherscheme(params);
|
||||
if (otherschemeNum > 0){
|
||||
throw new SalaryRunTimeException("该其他福利方案已被使用");
|
||||
}
|
||||
}
|
||||
|
||||
int billNum = siSchemeBiz.checkBeforeDeleteBill(params,welfareTypeId);
|
||||
if (billNum > 0){
|
||||
throw new SalaryRunTimeException("该福利方案已被核算");
|
||||
}
|
||||
siSchemeBiz.deleteSocialscheme(params);
|
||||
|
||||
return apidatas;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ 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 com.engine.salary.enums.sicategory.WelfareTypeEnum;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
|
@ -35,5 +35,10 @@ public class InsuranceSchemeReqParam {
|
|||
*/
|
||||
private List<InsuranceSchemeDetailDTO> insuranceSchemeDetailList;
|
||||
|
||||
/**
|
||||
* 福利类型
|
||||
*/
|
||||
private WelfareTypeEnum welfareTypeEnum;
|
||||
|
||||
private List<Long> ids;
|
||||
}
|
||||
|
|
@ -33,5 +33,5 @@ public interface SIAccountUtilMapper {
|
|||
* @param id
|
||||
* @return
|
||||
*/
|
||||
List<SIAccountUtilDTO> checkBeforeDeleteBill(@Param("ids") Collection<Long> id);
|
||||
List<SIAccountUtilDTO> checkBeforeDeleteBill(@Param("ids") Collection<Long> id,@Param("welfareTypeId") Integer welfareTypeId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -67,17 +67,24 @@
|
|||
hrsa_bill_detail
|
||||
WHERE
|
||||
delete_type = 0
|
||||
AND (social_scheme_id IN
|
||||
<foreach collection="ids" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
OR fund_scheme_id IN
|
||||
<foreach collection="ids" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
OR other_scheme_id IN
|
||||
<foreach collection="ids" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>)
|
||||
<if test="welfareTypeId == 1">
|
||||
AND social_scheme_id IN
|
||||
<foreach collection="ids" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="welfareTypeId == 2">
|
||||
AND fund_scheme_id IN
|
||||
<foreach collection="ids" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="welfareTypeId == 3">
|
||||
AND other_scheme_id IN
|
||||
<foreach collection="ids" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -736,7 +736,7 @@ public class TaxAgentServiceImpl extends Service implements TaxAgentService {
|
|||
@Override
|
||||
public List<TaxAgentEmployeeDTO> listTaxAgentAndEmployee(SalaryEmployeeStatusEnum employeeStatus, Long employeeId) {
|
||||
List<TaxAgentEmployeeDTO> taxAgentEmployeeList = Lists.newArrayList();
|
||||
|
||||
|
||||
List<TaxAgentManageRangeEmployeeDTO> taxAgentManageRangeEmployeeList = listTaxAgentAndEmployeeTree(employeeStatus, employeeId);
|
||||
taxAgentManageRangeEmployeeList.forEach(m -> {
|
||||
List<TaxAgentManageRangeEmployeeDTO.TaxAgentEmployee> employeeList = m.getEmployeeList();
|
||||
|
|
|
|||
|
|
@ -4,26 +4,21 @@ import com.engine.common.util.ParamUtil;
|
|||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.salary.entity.siaccount.po.InsuranceAccountInspectPO;
|
||||
import com.engine.salary.entity.siarchives.param.InsuranceArchivesListParam;
|
||||
import com.engine.salary.entity.siarchives.po.InsuranceArchivesEmployeePO;
|
||||
import com.engine.salary.entity.sischeme.dto.InsuranceSchemeListDTO;
|
||||
import com.engine.salary.entity.sischeme.param.InsuranceSchemeParam;
|
||||
import com.engine.salary.entity.sischeme.param.InsuranceSchemeReqParam;
|
||||
import com.engine.salary.entity.sischeme.param.SISchemaImportParam;
|
||||
import com.engine.salary.enums.sicategory.WelfareTypeEnum;
|
||||
import com.engine.salary.mapper.siarchives.SocialSchemeMapper;
|
||||
import com.engine.salary.service.SIAccountService;
|
||||
import com.engine.salary.service.SISchemeService;
|
||||
import com.engine.salary.service.impl.SIAccountServiceImpl;
|
||||
import com.engine.salary.service.impl.SISchemeServiceImpl;
|
||||
import com.engine.salary.util.ResponseResult;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
import com.engine.salary.util.page.SalaryPageUtil;
|
||||
import com.engine.salary.wrapper.SISchemeWrapper;
|
||||
import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.ibatis.session.SqlSession;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import weaver.conn.mybatis.MyBatisFactory;
|
||||
import weaver.hrm.HrmUserVarify;
|
||||
import weaver.hrm.User;
|
||||
|
||||
|
|
@ -36,7 +31,9 @@ import javax.ws.rs.core.Response;
|
|||
import javax.ws.rs.core.StreamingOutput;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.*;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
|
|
@ -155,6 +152,7 @@ public class SISchemeController {
|
|||
User user = HrmUserVarify.getUser(request, response);
|
||||
Map<String, Object> map = ParamUtil.request2Map(request);
|
||||
map.put("ids",insuranceSchemeReqParam.getIds());
|
||||
map.put("welfareTypeId", insuranceSchemeReqParam.getWelfareTypeEnum().getValue());
|
||||
return new ResponseResult< Map<String, Object>, Map<String, Object>>(user).run(getService(user)::delete,map);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue