Commit 68fa8fc2 authored by zhangch's avatar zhangch

优化添加失能申请逻辑、优化查询可以进行复评申请的列表的SQL

parent aa2209e4
...@@ -292,8 +292,7 @@ public class DisableController { ...@@ -292,8 +292,7 @@ public class DisableController {
if (chDisableApply.getMedicalType() == null) { if (chDisableApply.getMedicalType() == null) {
return Result.failed("医保类型不能为空!"); return Result.failed("医保类型不能为空!");
} }
disableService.addDisable(chDisableApply); return disableService.addDisable(chDisableApply);
return Result.success();
} }
/** /**
......
...@@ -3,6 +3,7 @@ package com.hungraim.ltc.service; ...@@ -3,6 +3,7 @@ package com.hungraim.ltc.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hungraim.ltc.pojo.entity.disable.*; import com.hungraim.ltc.pojo.entity.disable.*;
import com.hungraim.ltc.pojo.vo.disable.*; import com.hungraim.ltc.pojo.vo.disable.*;
import com.hungraim.ltc.util.Result;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List; import java.util.List;
...@@ -28,7 +29,7 @@ public interface DisableService { ...@@ -28,7 +29,7 @@ public interface DisableService {
*/ */
DisableExamineInfoVO disableExamineInfo(String applyId); DisableExamineInfoVO disableExamineInfo(String applyId);
void addDisable(ChDisableApply chDisableApply); Result addDisable(ChDisableApply chDisableApply);
void disableExamine(String applyId, String checkName, Short applyStatus, String checkRemark); void disableExamine(String applyId, String checkName, Short applyStatus, String checkRemark);
......
...@@ -2,6 +2,7 @@ package com.hungraim.ltc.service.impl; ...@@ -2,6 +2,7 @@ package com.hungraim.ltc.service.impl;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hungraim.ltc.api.AttachFeignService; import com.hungraim.ltc.api.AttachFeignService;
...@@ -114,11 +115,33 @@ public class DisableServiceImpl implements DisableService { ...@@ -114,11 +115,33 @@ public class DisableServiceImpl implements DisableService {
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@Override @Override
public void addDisable(ChDisableApply chDisableApply) { public Result addDisable(ChDisableApply chDisableApply) {
// 先查询当前人员有没有进行过首次申请,如果进行过就返回错误,如果当前人员有不是审核通过的复评申请,同样返回错误
// 姓名和身份证号相同视为同一个人
Short applyMethod = chDisableApply.getApplyMethod();
if (Objects.equals(Short.valueOf("1"), applyMethod)) {
// 首次申请校验
List<ChDisableApply> chDisableApplies = disableApplyMapper.selectList(new LambdaQueryWrapper<ChDisableApply>()
.eq(ChDisableApply::getRealName, chDisableApply.getRealName())
.eq(ChDisableApply::getCertiCode, chDisableApply.getCertiCode())
.eq(ChDisableApply::getApplyMethod, 1));
if (chDisableApplies.size() > 0) {
return Result.failed("该人员已经进行了首次申请");
}
} else if (Objects.equals(Short.valueOf("1"), applyMethod)) {
// 复评申请校验
List<ChDisableApply> chDisableApplies = disableApplyMapper.selectList(new LambdaQueryWrapper<ChDisableApply>()
.eq(ChDisableApply::getRealName, chDisableApply.getRealName())
.eq(ChDisableApply::getCertiCode, chDisableApply.getCertiCode())
.eq(ChDisableApply::getApplyMethod, 2).ne(ChDisableApply::getApplyStatus, 2));
if (chDisableApplies.size() > 0) {
return Result.failed("该人员有尚未审核通过的复评申请");
}
}
chDisableApply.setEffTime(new Date()); chDisableApply.setEffTime(new Date());
disableApplyMapper.insert(chDisableApply); disableApplyMapper.insert(chDisableApply);
this.updateAttachs(chDisableApply); this.updateAttachs(chDisableApply);
return Result.success();
} }
/** /**
......
...@@ -349,7 +349,8 @@ ...@@ -349,7 +349,8 @@
apply.BIRTHDAY birthday, apply.BIRTHDAY birthday,
apply.certi_code certiCode, apply.certi_code certiCode,
apply.tel tel apply.tel tel
from CH_APR_TASK task from CH_DISABLE_INFO info
left join CH_APR_TASK task ON info.LAST_TASK_ID = task.id
--适用机构 --适用机构
left join CH_FND_ORGAN fndOrgan on task.ORGAN_ID = fndOrgan.ORGAN_ID left join CH_FND_ORGAN fndOrgan on task.ORGAN_ID = fndOrgan.ORGAN_ID
--失能申请表 --失能申请表
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment