Commit 05056064 authored by zhangwanglin's avatar zhangwanglin

失能人员退出

parent 5933cd4d
...@@ -531,14 +531,7 @@ public class DisableController { ...@@ -531,14 +531,7 @@ public class DisableController {
if (disableExitVO.getDisableInfoId() == null|| disableExitVO.getExitReasonId() == null||disableExitVO.getApplyId() == null) { if (disableExitVO.getDisableInfoId() == null|| disableExitVO.getExitReasonId() == null||disableExitVO.getApplyId() == null) {
return Result.failed(ResultCode.REQUEST_PARAM_ERROR); return Result.failed(ResultCode.REQUEST_PARAM_ERROR);
} }
int i = disableService.disableInfoExit(disableExitVO); return disableService.disableInfoExit(disableExitVO);
if (i > 0) {
return Result.success();
} else {
return Result.failed();
}
} }
......
...@@ -185,7 +185,7 @@ public interface DisableService { ...@@ -185,7 +185,7 @@ public interface DisableService {
Integer applyMethod); Integer applyMethod);
int disableInfoExit(DisableExitVO disableExitVO); Result disableInfoExit(DisableExitVO disableExitVO);
void disableExitHanlder(Integer exitReasonId, Integer srvOrganId, Integer disableInfoId, Date date); void disableExitHanlder(Integer exitReasonId, Integer srvOrganId, Integer disableInfoId, Date date);
......
...@@ -637,7 +637,7 @@ public class DisableServiceImpl implements DisableService { ...@@ -637,7 +637,7 @@ public class DisableServiceImpl implements DisableService {
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public int disableInfoExit(DisableExitVO disableExitVO) { public Result disableInfoExit(DisableExitVO disableExitVO) {
String exitTime = disableExitVO.getExitTime(); String exitTime = disableExitVO.getExitTime();
Integer applyId = disableExitVO.getApplyId(); Integer applyId = disableExitVO.getApplyId();
Integer exitReasonId = disableExitVO.getExitReasonId(); Integer exitReasonId = disableExitVO.getExitReasonId();
...@@ -663,9 +663,21 @@ public class DisableServiceImpl implements DisableService { ...@@ -663,9 +663,21 @@ public class DisableServiceImpl implements DisableService {
boolean now = DateUtils.isNow(date); boolean now = DateUtils.isNow(date);
if (now) { if (now) {
disableExitHanlder(exitReasonId, srvOrganId, disableInfoId, date); 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; return Result.success();
} else {
return Result.failed();
}
} }
/** /**
...@@ -687,6 +699,7 @@ public class DisableServiceImpl implements DisableService { ...@@ -687,6 +699,7 @@ public class DisableServiceImpl implements DisableService {
UpdateWrapper updateWrapper2 = new UpdateWrapper(); UpdateWrapper updateWrapper2 = new UpdateWrapper();
updateWrapper2.eq("DISAB_INFO_ID", Long.valueOf(disableInfoId)); updateWrapper2.eq("DISAB_INFO_ID", Long.valueOf(disableInfoId));
updateWrapper2.notIn("status",2);
updateWrapper2.set("status", 2); updateWrapper2.set("status", 2);
updateWrapper2.set("LCD", new DATE()); updateWrapper2.set("LCD", new DATE());
updateWrapper2.set("end_reason", "失能人员退出,计划终止"); updateWrapper2.set("end_reason", "失能人员退出,计划终止");
...@@ -708,13 +721,16 @@ public class DisableServiceImpl implements DisableService { ...@@ -708,13 +721,16 @@ public class DisableServiceImpl implements DisableService {
chSrvSend1.setStatus((short)0); chSrvSend1.setStatus((short)0);
chSrvSendInfoMapper.insert(chSrvSend1); chSrvSendInfoMapper.insert(chSrvSend1);
} }
// 插入历史记录 if(srvOrganId != null) {
ChDisableExit chDisableExit = new ChDisableExit(); // 插入历史记录
chDisableExit.setDisabInfoId(disableInfoId); ChDisableExit chDisableExit = new ChDisableExit();
chDisableExit.setExitReasonId(exitReasonId); chDisableExit.setDisabInfoId(disableInfoId);
chDisableExit.setExitTime(date); chDisableExit.setExitReasonId(exitReasonId);
chDisableExit.setSrvOrganId(srvOrganId); chDisableExit.setExitTime(date);
disableExitMapper.insert(chDisableExit); chDisableExit.setSrvOrganId(srvOrganId);
disableExitMapper.insert(chDisableExit);
}
} }
@Override @Override
...@@ -745,7 +761,7 @@ public class DisableServiceImpl implements DisableService { ...@@ -745,7 +761,7 @@ public class DisableServiceImpl implements DisableService {
Long disabInfoId = disableInfoListVo.getDisabInfoId(); Long disabInfoId = disableInfoListVo.getDisabInfoId();
String exitTime = disableInfoListVo.getExitTime(); String exitTime = disableInfoListVo.getExitTime();
Date date = DateUtils.strToDate(exitTime); Date date = DateUtils.strToDate(exitTime);
disableExitHanlder(exitReasonId,srvOrganId.intValue(),disabInfoId.intValue(),date); disableExitHanlder(exitReasonId,null,disabInfoId.intValue(),date);
} }
} }
......
...@@ -45,32 +45,15 @@ ...@@ -45,32 +45,15 @@
<select id="getDisableExitList" resultType="com.hungraim.ltc.pojo.vo.disable.DisableInfoListVo"> <select id="getDisableExitList" resultType="com.hungraim.ltc.pojo.vo.disable.DisableInfoListVo">
SELECT distinct T2.DISAB_INFO_ID disabInfoId, SELECT distinct T2.DISAB_INFO_ID disabInfoId,
T1.PROGRAM_ID programId, T2.CERTI_CODE certiCode,
T6.SRV_ORGAN_ID srvOrganId, T2.APPLY_ID applyId,
T5.DISTRICT_PROVINCIAL districtProvincial, to_char(T2.EXIT_TIME,'yyyy-MM-dd') exitTime,
T5.DISTRICT_CITY districtCity, T2.EXIT_FLAG exitFlag,
T2.REAL_NAME realName, T2.EXIT_REASON_ID exitReasonId
T7.MODE_NAME svrModelName, FROM CH_DISABLE_INFO T2
T5.SRV_ORGAN_NAME svrOrganName, where T2.EXIT_TIME is not null
T1.PROG_STATUS progStatus, and T2.EXIT_TIME = to_date(to_char(sysdate,'yyyy-MM-dd'),'yyyy-MM-dd')
T1.EFF_TIME effTime,
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
and T2.EXIT_TIME = to_date(to_char(sysdate,'yyyy-MM-dd'),'yyyy-MM-dd')
</select> </select>
...@@ -86,6 +69,7 @@ ...@@ -86,6 +69,7 @@
<update id="updateSrvProgramById" parameterType="com.hungraim.ltc.pojo.entity.serviceManage.ChSrvProgram"> <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 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 g.DISAB_INFO_ID =#{disabInfoId} and g.PROGRAM_DATE <![CDATA[ < ]]> sysdate
and g.PROG_STATUS <![CDATA[ <> ]]>'2'
</update> </update>
<update id="updateSrvSendById" parameterType="com.hungraim.ltc.pojo.entity.serviceManage.ChSrvSend"> <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