Commit 0d28a63e authored by zhangwanglin's avatar zhangwanglin

定时分配多个护理人员处理

parent f069d405
......@@ -32,7 +32,7 @@ public class SrvTaskScheduledController {
@Scheduled(cron = "0 35 23 * * ?")
@Scheduled(cron = "0 20 23 * * ?")
public void timeAllocationSrvTask() {
boolean flag = redisLock.tryLock(JOB_KEY, 1000*30);
if(flag){
......
......@@ -146,6 +146,11 @@ public class SrvTaskServiceImpl implements SrvTaskService {
chSrvTask.setStatus((short) 1);//状态 未分配:0;已分配:1;已终止2
chSrvTask.setSrvDate(DateUtils.strToDate(taskDetails.get(0)));
srvTaskMapper.insert(chSrvTask);
// 服务计划制定方案修改为已生效
ChSrvProgram chSrvProgram = new ChSrvProgram();
chSrvProgram.setProgramId(Long.valueOf(programId));
chSrvProgram.setProgStatus(1);
chSrvProgramMapper.updateById(chSrvProgram);
//添加服务计划详情
Long newSrvTaskId = chSrvTask.getSrvTaskId();
this.insertTaskDetail(newSrvTaskId, taskDetails);
......@@ -243,6 +248,7 @@ public class SrvTaskServiceImpl implements SrvTaskService {
chSrvTaskDetail.setSrvTaskId(srvTaskId);//taskId
chSrvTaskDetail.setSrvDate(DateUtils.strToDate(dateStr));//服务开始时间
chSrvTaskDetail.setStatus((short) 0);//状态 未执行:0;执行中:1;已执行:2;已失效:3已完成4
chSrvTaskDetail.setFcd(new Date());
chSrvTaskDetailMapper.insert(chSrvTaskDetail);
// ch_srv_plan
String programId = chSrvTask.getProgramId();
......
......@@ -128,9 +128,7 @@
T4.FINISH_TIME assessDate,
T7.MODE_NAME svrModelName,
T5.SRV_ORGAN_NAME svrOrganName,
<if test="programStatus != null and programStatus != ''">
#{programStatus} progStatus,
</if>
T1.PROG_STATUS progStatus,
T1.EFF_TIME effTime
FROM CH_SRV_PROGRAM T1
INNER JOIN CH_DISABLE_INFO T2 ON T1.DISAB_INFO_ID = T2.DISAB_INFO_ID
......
......@@ -219,15 +219,22 @@
</where>
</select>
<select id="getAllocationSrvTask" resultType="com.hungraim.ltc.pojo.vo.governance.AllocationSrvTaskVO">
select t.SRV_TASK_ID,t.SRV_DATE,info.EXIT_TIME,info.EXIT_FLAG,info.EXIT_REASON_ID,t.program_id programId from CH_SRV_TASK t
select max(t.SRV_TASK_ID) srvTaskId,max(program.PROGRAM_ID) programId,info.REAL_NAME,t.SRV_EMP_ID from CH_SRV_TASK t
left join CH_DISABLE_INFO info on t.DISAB_INFO_ID = info.DISAB_INFO_ID
left join ch_apr_task aprtask on info.last_task_id = aprtask.task_id--评定任务
left join ch_apr_report report on aprtask.task_id = report.task_id--评定报告
left join CH_SRV_PROGRAM program on program.DISAB_INFO_ID = info.DISAB_INFO_ID
left join CH_SRV_PROGRAM program on program.program_id = t.program_id
where <![CDATA[ t.SRV_DATE < sysdate and
(info.EXIT_TIME > sysdate or info.EXIT_TIME is null)
and sysdate < program.PROGRAM_EDN_DATE
and sysdate > report.PUBLICITY_END_TIME and program.PROG_STATUS <>'2' and t.STATUS <>'2' ]]>
and sysdate > report.PUBLICITY_END_TIME and program.PROG_STATUS <>'2' and t.STATUS <>'2'
group by info.REAL_NAME,t.SRV_EMP_ID ]]>
</select>
</mapper>
\ No newline at end of file
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