Commit 25477c28 authored by zhangwanglin's avatar zhangwanglin

服务方案制定字段添加、护理记录排序、退出时间修改

parent 8a726e82
...@@ -162,7 +162,7 @@ from CH_SRV_TASK_FINISH_ITEM item ...@@ -162,7 +162,7 @@ from CH_SRV_TASK_FINISH_ITEM item
LEFT JOIN CH_SRV_ORGAN_PROJECT CSOP ON CSOP.PROJECT_ID = item.ITEM_ID LEFT JOIN CH_SRV_ORGAN_PROJECT CSOP ON CSOP.PROJECT_ID = item.ITEM_ID
left join CH_SERVICE_TYPE_DETAILED service on service.SERVICE_TYPE_DETAILED_ID = CSOP.ITEM_NAME left join CH_SERVICE_TYPE_DETAILED service on service.SERVICE_TYPE_DETAILED_ID = CSOP.ITEM_NAME
where to_char(detail.SRV_DATE, 'yyyy-MM') = #{req.accountsTime} and task.DISAB_INFO_ID = #{req.disabInfoId} where to_char(detail.SRV_DATE, 'yyyy-MM') = #{req.accountsTime} and task.DISAB_INFO_ID = #{req.disabInfoId}
and organ.SRV_ORGAN_ID = #{req.srvOrganId} order by detail.SRV_DATE desc,detail.TASK_DETAIL_ID and organ.SRV_ORGAN_ID = #{req.srvOrganId} order by detail.SRV_DATE desc,item.task_finish_item_id
</select> </select>
......
...@@ -77,8 +77,9 @@ ...@@ -77,8 +77,9 @@
<if test="req.srvOrganId != null and req.srvOrganId != '' and req.srvOrganId!=0"> <if test="req.srvOrganId != null and req.srvOrganId != '' and req.srvOrganId!=0">
AND organ.SRV_ORGAN_ID = #{req.srvOrganId} AND organ.SRV_ORGAN_ID = #{req.srvOrganId}
</if> </if>
</where>
</where>
order by status,taskDetailId
</select> </select>
......
...@@ -654,25 +654,25 @@ public class DisableServiceImpl implements DisableService { ...@@ -654,25 +654,25 @@ public class DisableServiceImpl implements DisableService {
ChDisableInfo chDisableInfo = new ChDisableInfo(); ChDisableInfo chDisableInfo = new ChDisableInfo();
chDisableInfo.setDisabInfoId(disableInfoId); chDisableInfo.setDisabInfoId(disableInfoId);
chDisableInfo.setExitFlag(1); chDisableInfo.setExitFlag(1);
chDisableInfo.setExitTime(date); chDisableInfo.setExitTime(date);
chDisableInfo.setExitReasonId(exitReasonId); chDisableInfo.setExitReasonId(exitReasonId);
chDisableInfo.setLcd(new Date());
chDisableInfo.setExitSrvOrganId(srvOrganId); chDisableInfo.setExitSrvOrganId(srvOrganId);
int result = disableInfoMapper.updateById(chDisableInfo); int result = disableInfoMapper.updateById(chDisableInfo);
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 { // } else {
// 插入历史记录 // // 插入历史记录
ChDisableExit chDisableExit = new ChDisableExit(); // ChDisableExit chDisableExit = new ChDisableExit();
chDisableExit.setDisabInfoId(disableInfoId); // chDisableExit.setDisabInfoId(disableInfoId);
chDisableExit.setExitReasonId(exitReasonId); // chDisableExit.setExitReasonId(exitReasonId);
chDisableExit.setExitTime(date); // chDisableExit.setExitTime(date);
chDisableExit.setSrvOrganId(srvOrganId); // chDisableExit.setSrvOrganId(srvOrganId);
disableExitMapper.insert(chDisableExit); // disableExitMapper.insert(chDisableExit);
return Result.failed("操作成功,退出状态及服务方案和计划将在"+exitTime+"日自动终止"); // return Result.failed("操作成功,退出状态及服务方案和计划将在"+exitTime+"日自动终止");
} // }
if (result > 0) { if (result > 0) {
return Result.success(); return Result.success();
} else { } else {
...@@ -695,6 +695,7 @@ public class DisableServiceImpl implements DisableService { ...@@ -695,6 +695,7 @@ public class DisableServiceImpl implements DisableService {
chSrvProgram.setDisabInfoId(Long.valueOf(disableInfoId)); chSrvProgram.setDisabInfoId(Long.valueOf(disableInfoId));
chSrvProgram.setProgStatus(2); chSrvProgram.setProgStatus(2);
chSrvProgram.setEndReason("失能人员退出,终止方案"); chSrvProgram.setEndReason("失能人员退出,终止方案");
chSrvProgram.setLcd(new Date());
disableInfoMapper.updateSrvProgramById(chSrvProgram); disableInfoMapper.updateSrvProgramById(chSrvProgram);
UpdateWrapper updateWrapper2 = new UpdateWrapper(); UpdateWrapper updateWrapper2 = new UpdateWrapper();
...@@ -708,7 +709,7 @@ public class DisableServiceImpl implements DisableService { ...@@ -708,7 +709,7 @@ public class DisableServiceImpl implements DisableService {
ChSrvSend chSrvSend = new ChSrvSend(); ChSrvSend chSrvSend = new ChSrvSend();
chSrvSend.setDisabInfoId(Long.valueOf(disableInfoId)); chSrvSend.setDisabInfoId(Long.valueOf(disableInfoId));
chSrvSend.setEndTime(date); chSrvSend.setEndTime(date);
chSrvSend.setLcd(new Date());
// 更新已分配为已退出 // 更新已分配为已退出
chSrvSend.setStatus((short)3); chSrvSend.setStatus((short)3);
disableInfoMapper.updateSrvSendById(chSrvSend); disableInfoMapper.updateSrvSendById(chSrvSend);
......
package com.hungraim.ltc.pojo.entity.governance; package com.hungraim.ltc.pojo.entity.governance;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.annotation.KeySequence;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data; import lombok.Data;
import java.util.Date; import java.util.Date;
...@@ -26,5 +23,10 @@ public class ChSrvPlan { ...@@ -26,5 +23,10 @@ public class ChSrvPlan {
private Long isStatus; private Long isStatus;
private Long isBill; private Long isBill;
private Date lcd; private Date lcd;
@TableField(exist = false)
private String itemWeek;
@TableField(exist = false)
private String planningFrequencyType;
} }
...@@ -154,5 +154,7 @@ public class ChSrvProgramSet implements Serializable { ...@@ -154,5 +154,7 @@ public class ChSrvProgramSet implements Serializable {
*/ */
private String remark; private String remark;
private String itemWeek;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
} }
\ No newline at end of file
...@@ -3,6 +3,7 @@ package com.hungraim.ltc.pojo.vo.governance; ...@@ -3,6 +3,7 @@ package com.hungraim.ltc.pojo.vo.governance;
import lombok.Data; import lombok.Data;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.List;
@Data @Data
public class ProgramSetAndProjectVo { public class ProgramSetAndProjectVo {
...@@ -72,4 +73,9 @@ public class ProgramSetAndProjectVo { ...@@ -72,4 +73,9 @@ public class ProgramSetAndProjectVo {
*/ */
private Short planningFrequencyType = 1; private Short planningFrequencyType = 1;
private String itemWeek;
private List<String> itemWeeks;
} }
...@@ -53,7 +53,7 @@ public class SrvPlanInputVO { ...@@ -53,7 +53,7 @@ public class SrvPlanInputVO {
private Long taskDetailId; private Long taskDetailId;
@TableField(exist = false) @TableField(exist = false)
private List<ChFndAttach> fileDataList; private List<ChFndAttach> fileDataList;
} }
...@@ -22,10 +22,14 @@ import com.hungraim.ltc.util.Result; ...@@ -22,10 +22,14 @@ import com.hungraim.ltc.util.Result;
import com.hungraim.ltc.util.ResultCode; import com.hungraim.ltc.util.ResultCode;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import oracle.sql.DATE; import oracle.sql.DATE;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
...@@ -78,6 +82,19 @@ public class SrvProgramServiceImpl implements SrvProgramService { ...@@ -78,6 +82,19 @@ public class SrvProgramServiceImpl implements SrvProgramService {
List<ChFndAttach> data = listResult.getData(); List<ChFndAttach> data = listResult.getData();
programDetail.setFileDataList(data); programDetail.setFileDataList(data);
} }
List<ProgramSetAndProjectVo> programSetAndProjectVos = programDetail.getProgramSetAndProjectVos();
for (ProgramSetAndProjectVo programSetAndProjectVo : programSetAndProjectVos) {
String itemWeek = programSetAndProjectVo.getItemWeek();
if (StringUtils.isNotEmpty(itemWeek)) {
List<String> itemWeeks = new ArrayList<>();
List<String> list = Arrays.asList(itemWeek.split(","));
for (String s : list) {
itemWeeks.add(s);
}
programSetAndProjectVo.setItemWeeks(itemWeeks);
}
}
return programDetail; return programDetail;
} }
...@@ -134,6 +151,11 @@ public class SrvProgramServiceImpl implements SrvProgramService { ...@@ -134,6 +151,11 @@ public class SrvProgramServiceImpl implements SrvProgramService {
chSrvProgramSet.setPlanningFrequency(programSetAndProjectVo.getPlanningFrequency()); chSrvProgramSet.setPlanningFrequency(programSetAndProjectVo.getPlanningFrequency());
chSrvProgramSet.setPlanningFrequencyType(programSetAndProjectVo.getPlanningFrequencyType()); chSrvProgramSet.setPlanningFrequencyType(programSetAndProjectVo.getPlanningFrequencyType());
chSrvProgramSet.setRemark(programSetAndProjectVo.getRemark()); chSrvProgramSet.setRemark(programSetAndProjectVo.getRemark());
List<String> itemWeeks = programSetAndProjectVo.getItemWeeks();
if (CollectionUtils.isNotEmpty(itemWeeks)) {
String itemWeek = StringUtils.join(itemWeeks,",");
chSrvProgramSet.setItemWeek(itemWeek);
}
chSrvProgramSetMapper.updateById(chSrvProgramSet); chSrvProgramSetMapper.updateById(chSrvProgramSet);
} else { } else {
if (isConf.intValue() == 0) { if (isConf.intValue() == 0) {
...@@ -197,6 +219,11 @@ public class SrvProgramServiceImpl implements SrvProgramService { ...@@ -197,6 +219,11 @@ public class SrvProgramServiceImpl implements SrvProgramService {
chSrvProgramSet.setPlanningFrequency(programSetAndProjectVo.getPlanningFrequency()); chSrvProgramSet.setPlanningFrequency(programSetAndProjectVo.getPlanningFrequency());
chSrvProgramSet.setPlanningFrequencyType(programSetAndProjectVo.getPlanningFrequencyType()); chSrvProgramSet.setPlanningFrequencyType(programSetAndProjectVo.getPlanningFrequencyType());
chSrvProgramSet.setRemark(programSetAndProjectVo.getRemark()); chSrvProgramSet.setRemark(programSetAndProjectVo.getRemark());
List<String> itemWeeks = programSetAndProjectVo.getItemWeeks();
if (CollectionUtils.isNotEmpty(itemWeeks)) {
String itemWeek = StringUtils.join(itemWeeks,",");
chSrvProgramSet.setItemWeek(itemWeek);
}
chSrvProgramSetMapper.insert(chSrvProgramSet); chSrvProgramSetMapper.insert(chSrvProgramSet);
} }
......
...@@ -26,10 +26,14 @@ import com.hungraim.ltc.util.Result; ...@@ -26,10 +26,14 @@ import com.hungraim.ltc.util.Result;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import oracle.sql.DATE; import oracle.sql.DATE;
import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
...@@ -161,7 +165,7 @@ public class SrvTaskServiceImpl implements SrvTaskService { ...@@ -161,7 +165,7 @@ public class SrvTaskServiceImpl implements SrvTaskService {
//添加服务计划详情 //添加服务计划详情
Long newSrvTaskId = chSrvTask.getSrvTaskId(); Long newSrvTaskId = chSrvTask.getSrvTaskId();
this.insertTaskDetail(newSrvTaskId, taskDetails); this.insertTaskDetail(newSrvTaskId, taskDetails);
saveSrvPlan(programId, null); saveSrvPlan(programId, taskDetails.get(0));
//添加附件 //添加附件
// this.updateAttachs(srvTaskInfoVO.getListAttach(), chSrvTask.getSrvTaskId()); // this.updateAttachs(srvTaskInfoVO.getListAttach(), chSrvTask.getSrvTaskId());
} else { } else {
...@@ -196,10 +200,43 @@ public class SrvTaskServiceImpl implements SrvTaskService { ...@@ -196,10 +200,43 @@ public class SrvTaskServiceImpl implements SrvTaskService {
List<ChSrvPlan> chSrvPlans = chSrvPlanMapper.queryPlan(programId, srvPlanTime); List<ChSrvPlan> chSrvPlans = chSrvPlanMapper.queryPlan(programId, srvPlanTime);
for (ChSrvPlan chSrvPlan : chSrvPlans) { for (ChSrvPlan chSrvPlan : chSrvPlans) {
chSrvPlan.setCreationTime(new Date()); chSrvPlan.setCreationTime(new Date());
String itemWeek = chSrvPlan.getItemWeek();
String planningFrequencyType = chSrvPlan.getPlanningFrequencyType();
// 次周 3
if (StringUtils.isNotEmpty(itemWeek) && "3".equals(planningFrequencyType)) {
String weekDay = getweekDay(srvPlanTime);
if(!itemWeek.contains(weekDay)){
continue;
}
}
chSrvPlanMapper.insert(chSrvPlan); chSrvPlanMapper.insert(chSrvPlan);
} }
} }
public String getweekDay(String date) {
String[] weekDays = {"7", "1", "2", "3", "4", "5", "6"};
//转换为Date类型
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Date date1 = null;
try {
date1 = sdf.parse(date);
} catch (ParseException e) {
e.printStackTrace();
}
//判断日期是星期几
Calendar cal = Calendar.getInstance();
cal.setTime(date1);
int w = cal.get(Calendar.DAY_OF_WEEK) - 1;
if (w < 0) {
w = 0;
}
System.out.println(weekDays[w]);
return weekDays[w];
}
// mode_id 4 // mode_id 4
@Override @Override
public void otherPlaceHandler(String programId) { public void otherPlaceHandler(String programId) {
......
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
<result column="SRV_ORGAN_ID" property="itemTimes"/> <result column="SRV_ORGAN_ID" property="itemTimes"/>
<result column="ITEM_TIMES_TYPE" property="itemTimesType"/> <result column="ITEM_TIMES_TYPE" property="itemTimesType"/>
<result column="ITEM_PRICE" property="itemPrice"/> <result column="ITEM_PRICE" property="itemPrice"/>
<result column="ITEM_WEEK" property="itemWeek"/>
<result column="IS_NEED" property="isNeed"/> <result column="IS_NEED" property="isNeed"/>
<result column="PLANNING_FREQUENCY" property="planningFrequency"/> <result column="PLANNING_FREQUENCY" property="planningFrequency"/>
<result column="PLANNING_FREQUENCY_TYPE" property="planningFrequencyType"/> <result column="PLANNING_FREQUENCY_TYPE" property="planningFrequencyType"/>
...@@ -63,6 +64,7 @@ ...@@ -63,6 +64,7 @@
PLANNING_FREQUENCY, PLANNING_FREQUENCY,
PLANNING_FREQUENCY_TYPE, PLANNING_FREQUENCY_TYPE,
CH_SRV_PROGRAM_SET.REMARK, CH_SRV_PROGRAM_SET.REMARK,
CH_SRV_PROGRAM_SET.ITEM_WEEK,
NVL(CH_SRV_PROGRAM_SET.IS_CONF, '0') IS_CONF NVL(CH_SRV_PROGRAM_SET.IS_CONF, '0') IS_CONF
</if> </if>
FROM CH_SRV_ORGAN_PROJECT FROM CH_SRV_ORGAN_PROJECT
......
...@@ -15,7 +15,9 @@ ...@@ -15,7 +15,9 @@
detail.TASK_DETAIL_ID taskDetailId, detail.TASK_DETAIL_ID taskDetailId,
d.SERVICE_TYPE_DETAILED_NAME itemName, d.SERVICE_TYPE_DETAILED_NAME itemName,
CSTFI.ITEM_ID itemId, CSTFI.ITEM_ID itemId,
'0' isStatus '0' isStatus,
CSTFI.PLANNING_FREQUENCY_TYPE planningFrequencyType,
CSTFI.item_week itemWeek
from ch_srv_task_detail detail --服务计划 from ch_srv_task_detail detail --服务计划
left join ch_srv_task task on task.srv_task_id = detail.srv_task_id--服务计划详情 left join ch_srv_task task on task.srv_task_id = detail.srv_task_id--服务计划详情
left join ch_disable_info disable on task.disab_info_id = disable.disab_info_id--失能人员 left join ch_disable_info disable on task.disab_info_id = disable.disab_info_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