Commit 05056064 authored by zhangwanglin's avatar zhangwanglin

失能人员退出

parent 5933cd4d
......@@ -531,14 +531,7 @@ public class DisableController {
if (disableExitVO.getDisableInfoId() == null|| disableExitVO.getExitReasonId() == null||disableExitVO.getApplyId() == null) {
return Result.failed(ResultCode.REQUEST_PARAM_ERROR);
}
int i = disableService.disableInfoExit(disableExitVO);
if (i > 0) {
return Result.success();
} else {
return Result.failed();
}
return disableService.disableInfoExit(disableExitVO);
}
......
......@@ -185,7 +185,7 @@ public interface DisableService {
Integer applyMethod);
int disableInfoExit(DisableExitVO disableExitVO);
Result disableInfoExit(DisableExitVO disableExitVO);
void disableExitHanlder(Integer exitReasonId, Integer srvOrganId, Integer disableInfoId, Date date);
......
......@@ -637,7 +637,7 @@ public class DisableServiceImpl implements DisableService {
@Override
@Transactional(rollbackFor = Exception.class)
public int disableInfoExit(DisableExitVO disableExitVO) {
public Result disableInfoExit(DisableExitVO disableExitVO) {
String exitTime = disableExitVO.getExitTime();
Integer applyId = disableExitVO.getApplyId();
Integer exitReasonId = disableExitVO.getExitReasonId();
......@@ -663,9 +663,21 @@ public class DisableServiceImpl implements DisableService {
boolean now = DateUtils.isNow(date);
if (now) {
disableExitHanlder(exitReasonId, srvOrganId, disableInfoId, date);
} else {
// 插入历史记录
ChDisableExit chDisableExit = new ChDisableExit();
chDisableExit.setDisabInfoId(disableInfoId);
chDisableExit.setExitReasonId(exitReasonId);
chDisableExit.setExitTime(date);
chDisableExit.setSrvOrganId(srvOrganId);
disableExitMapper.insert(chDisableExit);
return Result.failed("操作成功,退出状态及服务方案和计划将在"+exitTime+"日自动终止");
}
if (result > 0) {
return Result.success();
} else {
return Result.failed();
}
return result;
}
/**
......@@ -687,6 +699,7 @@ public class DisableServiceImpl implements DisableService {
UpdateWrapper updateWrapper2 = new UpdateWrapper();
updateWrapper2.eq("DISAB_INFO_ID", Long.valueOf(disableInfoId));
updateWrapper2.notIn("status",2);
updateWrapper2.set("status", 2);
updateWrapper2.set("LCD", new DATE());
updateWrapper2.set("end_reason", "失能人员退出,计划终止");
......@@ -708,6 +721,7 @@ public class DisableServiceImpl implements DisableService {
chSrvSend1.setStatus((short)0);
chSrvSendInfoMapper.insert(chSrvSend1);
}
if(srvOrganId != null) {
// 插入历史记录
ChDisableExit chDisableExit = new ChDisableExit();
chDisableExit.setDisabInfoId(disableInfoId);
......@@ -715,6 +729,8 @@ public class DisableServiceImpl implements DisableService {
chDisableExit.setExitTime(date);
chDisableExit.setSrvOrganId(srvOrganId);
disableExitMapper.insert(chDisableExit);
}
}
@Override
......@@ -745,7 +761,7 @@ public class DisableServiceImpl implements DisableService {
Long disabInfoId = disableInfoListVo.getDisabInfoId();
String exitTime = disableInfoListVo.getExitTime();
Date date = DateUtils.strToDate(exitTime);
disableExitHanlder(exitReasonId,srvOrganId.intValue(),disabInfoId.intValue(),date);
disableExitHanlder(exitReasonId,null,disabInfoId.intValue(),date);
}
}
......
......@@ -45,31 +45,14 @@
<select id="getDisableExitList" resultType="com.hungraim.ltc.pojo.vo.disable.DisableInfoListVo">
SELECT distinct T2.DISAB_INFO_ID disabInfoId,
T1.PROGRAM_ID programId,
T6.SRV_ORGAN_ID srvOrganId,
T5.DISTRICT_PROVINCIAL districtProvincial,
T5.DISTRICT_CITY districtCity,
T2.REAL_NAME realName,
T7.MODE_NAME svrModelName,
T5.SRV_ORGAN_NAME svrOrganName,
T1.PROG_STATUS progStatus,
T1.EFF_TIME effTime,
SELECT distinct T2.DISAB_INFO_ID disabInfoId,
T2.CERTI_CODE certiCode,
T2.APPLY_ID applyId,
to_char(T2.EXIT_TIME,'yyyy-MM-dd') exitTime,
--服务方案起始日
--服务方案终止日
to_char(T1.PROGRAM_DATE,'yyyy-MM-dd HH24:mi:ss') programDate,
to_char(T1.PROGRAM_EDN_DATE,'yyyy-MM-dd HH24:mi:ss') programEdnDate,
T2.EXIT_FLAG exitFlag,
T2.EXIT_REASON_ID exitReasonId
FROM CH_DISABLE_INFO T2
inner join (select * from CH_SRV_SEND where STATUS in(1,3)) T6 on T6.DISAB_INFO_ID = T2.DISAB_INFO_ID
LEFT JOIN CH_SRV_PROGRAM T1 ON T1.DISAB_INFO_ID = T2.DISAB_INFO_ID
LEFT JOIN CH_CFG_SRV_MODE T7 ON T2.SRV_MODE_ID = T7.MODE_ID
LEFT JOIN CH_SRV_ORGAN T5 ON T6.SRV_ORGAN_ID = T5.SRV_ORGAN_ID
where T2.EXIT_TIME is not null
FROM CH_DISABLE_INFO T2
where T2.EXIT_TIME is not null
and T2.EXIT_TIME = to_date(to_char(sysdate,'yyyy-MM-dd'),'yyyy-MM-dd')
</select>
......@@ -86,6 +69,7 @@
<update id="updateSrvProgramById" parameterType="com.hungraim.ltc.pojo.entity.serviceManage.ChSrvProgram">
update CH_SRV_PROGRAM g set g.PROG_STATUS ='2',g.END_REASON = #{endReason} where
g.DISAB_INFO_ID =#{disabInfoId} and g.PROGRAM_DATE <![CDATA[ < ]]> sysdate
and g.PROG_STATUS <![CDATA[ <> ]]>'2'
</update>
<update id="updateSrvSendById" parameterType="com.hungraim.ltc.pojo.entity.serviceManage.ChSrvSend">
......
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