Commit ad4884d9 authored by 董天德's avatar 董天德

Merge branch 'dev_nursing_records_20230214' into uat_ch_master

# Conflicts: # apply/apply-service/src/main/java/com/hungraim/ltc/dao/ChSrvTaskDetailMapper.java
parents cf6fa110 d6f719c0
package com.hungraim.ltc.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hungraim.ltc.pojo.entity.serviceManage.ChSrvTask;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;
@Mapper
@Repository
public interface ChSrvTaskMapper extends BaseMapper<ChSrvTask> {
}
\ No newline at end of file
...@@ -38,6 +38,9 @@ public interface DisableInfoMapper extends BaseMapper<ChDisableInfo> { ...@@ -38,6 +38,9 @@ public interface DisableInfoMapper extends BaseMapper<ChDisableInfo> {
List<ProgramRespDTO> selectProgram(String disabInfoId, String srvOrganId); List<ProgramRespDTO> selectProgram(String disabInfoId, String srvOrganId);
int selectSrvSend(String disabInfoId);
int updateSrvProgramById(ChSrvProgram chSrvProgram); int updateSrvProgramById(ChSrvProgram chSrvProgram);
......
...@@ -8,6 +8,7 @@ import cn.hutool.core.collection.CollectionUtil; ...@@ -8,6 +8,7 @@ import cn.hutool.core.collection.CollectionUtil;
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.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
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;
...@@ -30,8 +31,8 @@ import com.hungraim.ltc.util.Result; ...@@ -30,8 +31,8 @@ import com.hungraim.ltc.util.Result;
import com.hungraim.ltc.util.ResultCode; import com.hungraim.ltc.util.ResultCode;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import oracle.sql.DATE;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.apache.poi.hssf.record.common.FeatSmartTag;
import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -64,12 +65,15 @@ public class DisableServiceImpl implements DisableService { ...@@ -64,12 +65,15 @@ public class DisableServiceImpl implements DisableService {
private final OrganService organService; private final OrganService organService;
private final ChSrvSendInfoMapper chSrvSendInfoMapper; private final ChSrvSendInfoMapper chSrvSendInfoMapper;
private final ChSrvTaskMapper chSrvTaskMapper;
@Autowired @Autowired
private ChDisableRiskLevelMapper chDisableRiskLevelMapper; private ChDisableRiskLevelMapper chDisableRiskLevelMapper;
/** /**
* 获取机构ids * 获取机构ids
* *
...@@ -579,7 +583,22 @@ public class DisableServiceImpl implements DisableService { ...@@ -579,7 +583,22 @@ public class DisableServiceImpl implements DisableService {
@Override @Override
public Page<DisableInfoListVo> getDisableInfoList(Page<DisableInfoListVo> page, Long srvOrganId,String certiCode,String realName,String svrModelId) { public Page<DisableInfoListVo> getDisableInfoList(Page<DisableInfoListVo> page, Long srvOrganId,String certiCode,String realName,String svrModelId) {
return disableInfoMapper.getDisableInfoList(page, srvOrganId,certiCode,realName,svrModelId); Page<DisableInfoListVo> disableInfoList = disableInfoMapper.getDisableInfoList(page, srvOrganId, certiCode, realName, svrModelId);
List<DisableInfoListVo> records = disableInfoList.getRecords();
for (DisableInfoListVo record : records) {
if(record.getExitReasonId()!=null){
Long disabInfoId = record.getDisabInfoId();
int count = disableInfoMapper.selectSrvSend(String.valueOf(disabInfoId));
if(count > 0) {
record.setExitFlag(null);
record.setExitReasonId(null);
record.setExitTime(null);
}
}
}
return disableInfoList;
} }
...@@ -666,22 +685,22 @@ public class DisableServiceImpl implements DisableService { ...@@ -666,22 +685,22 @@ public class DisableServiceImpl implements DisableService {
chSrvProgram.setEndReason("失能人员退出,终止方案"); chSrvProgram.setEndReason("失能人员退出,终止方案");
disableInfoMapper.updateSrvProgramById(chSrvProgram); disableInfoMapper.updateSrvProgramById(chSrvProgram);
UpdateWrapper updateWrapper2 = new UpdateWrapper();
updateWrapper2.eq("DISAB_INFO_ID", Long.valueOf(disableInfoId));
updateWrapper2.set("status", 2);
updateWrapper2.set("LCD", new DATE());
updateWrapper2.set("end_reason", "失能人员退出,计划终止");
chSrvTaskMapper.update(null, updateWrapper2);
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.setStatus((short)3);
disableInfoMapper.updateSrvSendById(chSrvSend);
//4,转入医保 5, 异地 选择原因转入医保和异地,保留原服务机构分配数据,状态为已分配,只终止方案和计划,保留终止后的方案和计划历史数据 //4,转入医保 5, 异地 选择原因转入医保和异地,保留原服务机构分配数据,状态为已分配,只终止方案和计划,保留终止后的方案和计划历史数据
if (exitReasonId == 4||exitReasonId==5){ if (exitReasonId != 1){
// chSrvSend.setStatus((short)3);
// disableInfoMapper.updateSrvSendById(chSrvSend);
// 1, 死亡
}else if (exitReasonId == 1){
// 更新已分配为已退出
chSrvSend.setStatus((short)3);
disableInfoMapper.updateSrvSendById(chSrvSend);
}else {
chSrvSend.setStatus((short)3);
// 更新为已退出
disableInfoMapper.updateSrvSendById(chSrvSend);
// 插入一条未分配的记录 // 插入一条未分配的记录
ChSrvSend chSrvSend1 = new ChSrvSend(); ChSrvSend chSrvSend1 = new ChSrvSend();
chSrvSend1.setDisabInfoId(Long.valueOf(disableInfoId)); chSrvSend1.setDisabInfoId(Long.valueOf(disableInfoId));
......
...@@ -40,6 +40,7 @@ import java.text.ParseException; ...@@ -40,6 +40,7 @@ import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@Service @Service
...@@ -211,25 +212,27 @@ public class SrvOrganEmpServiceImpl implements SrvOrganEmpService { ...@@ -211,25 +212,27 @@ public class SrvOrganEmpServiceImpl implements SrvOrganEmpService {
Date srvEndTime = chSrvTaskDetail.getSrvEndTime(); Date srvEndTime = chSrvTaskDetail.getSrvEndTime();
String srvEndTimeStr = DateUtils.dateTimeToStr(srvEndTime); String srvEndTimeStr = DateUtils.dateTimeToStr(srvEndTime);
Long min = dateDiff(srvStartTimeStr, srvEndTimeStr, "yyyy-MM-dd HH:mm:ss", "min"); Long min = dateDiff(srvStartTimeStr, srvEndTimeStr, "yyyy-MM-dd HH:mm:ss", "min");
if(min>=90){ if(min>=90) {
Date srvDate = chSrvTaskDetail.getSrvDate(); Date srvDate = chSrvTaskDetail.getSrvDate();
String srvDateStr = DateUtils.dateToStrYm(srvDate); String srvDateStr = DateUtils.dateToStrYm(srvDate);
Long srvTaskId = chSrvTaskDetail.getSrvTaskId(); Long srvTaskId = chSrvTaskDetail.getSrvTaskId();
String disabInfoId = chSrvTaskDetailMapper.selectBySrvTaskId(String.valueOf(srvTaskId)); String disabInfoId = chSrvTaskDetailMapper.selectBySrvTaskId(String.valueOf(srvTaskId));
ChDisabDetailAccounts chDisabDetailAccounts = chSrvTaskDetailMapper.selectAccountsDetail(disabInfoId, srvDateStr); ChDisabDetailAccounts chDisabDetailAccounts = chSrvTaskDetailMapper.selectAccountsDetail(disabInfoId, srvDateStr);
Short status = chDisabDetailAccounts.getStatus(); if (Objects.nonNull(chDisabDetailAccounts)) {
if(status != 0){ Short status = chDisabDetailAccounts.getStatus();
// 已申报不能进行删除 if (status != 0) {
return Result.failed("已申报不能进行删除"); // 已申报不能进行删除
return Result.failed("已申报不能进行删除");
}
BigDecimal accountsAllCost = chDisabDetailAccounts.getAccountsAllCost();
BigDecimal accountsPersonalCost = chDisabDetailAccounts.getAccountsPersonalCost();
BigDecimal accountsOverallCost = chDisabDetailAccounts.getAccountsOverallCost();
BigDecimal accountsAllCostsub = accountsAllCost.subtract(new BigDecimal(75));
BigDecimal accountsOverallCostsub = accountsOverallCost.subtract(new BigDecimal(60));
BigDecimal accountsPersonalCostsub = accountsPersonalCost.subtract(new BigDecimal(15));
Long accountsDetailId = chDisabDetailAccounts.getAccountsDetailId();
chSrvTaskDetailMapper.updateChDisabDetailAccounts(accountsDetailId, accountsAllCostsub, accountsOverallCostsub, accountsPersonalCostsub);
} }
BigDecimal accountsAllCost = chDisabDetailAccounts.getAccountsAllCost();
BigDecimal accountsPersonalCost = chDisabDetailAccounts.getAccountsPersonalCost();
BigDecimal accountsOverallCost = chDisabDetailAccounts.getAccountsOverallCost();
BigDecimal accountsAllCostsub = accountsAllCost.subtract(new BigDecimal(75));
BigDecimal accountsOverallCostsub = accountsOverallCost.subtract(new BigDecimal(60));
BigDecimal accountsPersonalCostsub = accountsPersonalCost.subtract(new BigDecimal(15));
Long accountsId = chDisabDetailAccounts.getAccountsId();
chSrvTaskDetailMapper.updateChDisabDetailAccounts(accountsId,accountsAllCostsub,accountsOverallCostsub,accountsPersonalCostsub);
} }
} }
chSrvTaskDetailMapper.deleteFinshItem(taskDetailId); chSrvTaskDetailMapper.deleteFinshItem(taskDetailId);
......
...@@ -128,7 +128,7 @@ WHERE TASK_DETAIL_ID = #{taskDetailId} ...@@ -128,7 +128,7 @@ WHERE TASK_DETAIL_ID = #{taskDetailId}
<update id = "updateChDisabDetailAccounts"> <update id = "updateChDisabDetailAccounts">
UPDATE CH_DISAB_ACCOUNTS_DETAIL d SET d.ACCOUNTS_ALL_COST = #{accountsAllCostsub}, d.ACCOUNTS_OVERALL_COST = #{accountsOverallCostsub}, UPDATE CH_DISAB_ACCOUNTS_DETAIL d SET d.ACCOUNTS_ALL_COST = #{accountsAllCostsub}, d.ACCOUNTS_OVERALL_COST = #{accountsOverallCostsub},
d.ACCOUNTS_PERSONAL_COST = #{accountsPersonalCostsub} d.ACCOUNTS_PERSONAL_COST = #{accountsPersonalCostsub}
WHERE d.ACCOUNTS_ID = #{accountsId} WHERE d.ACCOUNTS_DETAIL_ID = #{accountsDetailId}
</update> </update>
<select id="selectBySrvTaskId" resultType="java.lang.String"> <select id="selectBySrvTaskId" resultType="java.lang.String">
......
...@@ -2,52 +2,39 @@ ...@@ -2,52 +2,39 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hungraim.ltc.dao.DisableInfoMapper"> <mapper namespace="com.hungraim.ltc.dao.DisableInfoMapper">
<select id="getDisableInfoList" resultType="com.hungraim.ltc.pojo.vo.disable.DisableInfoListVo"> <select id="getDisableInfoList" resultType="com.hungraim.ltc.pojo.vo.disable.DisableInfoListVo">
SELECT distinct T2.DISAB_INFO_ID disabInfoId, with bb as (
T1.PROGRAM_ID programId, SELECT T2.DISAB_INFO_ID disabInfoId,
T1.SRV_ORGAN_ID srvOrganId, max(T6.SRV_ORGAN_ID) srvOrganId,
T5.DISTRICT_PROVINCIAL districtProvincial, T2.REAL_NAME realName,
T5.DISTRICT_CITY districtCity, DECODE(max(T2.SRV_MODE_ID), '1','医疗','2', '养老','3','上门', '4', '异地') svrModelName,
T2.REAL_NAME realName, max(T5.SRV_ORGAN_NAME) svrOrganName,
T2.TEL realTel, to_char(max(e.EXIT_TIME),'yyyy-MM-dd') exitTime,
T2.BIRTHDAY birthday, max(T2.CERTI_CODE) CERTI_CODE,
T2.GENDER gender, max(e.EXIT_REASON_ID) exitReasonId,
T2.ACPT_PROVINCIAL acptProvincial, max(T6.FCD) fcd,
T2.ACPT_CITY acptCity, to_char(max(apply.apply_time),'yyyy-MM-dd HH24:mi:ss') applyTime,
T2.ACPT_AREA acptArea, max(apply.apply_id) applyId
T2.ACPT_STREET acptStreet, FROM CH_SRV_SEND T6
T2.ACPT_ADDRESS acptAddress, LEFT join CH_DISABLE_INFO T2 on T6.DISAB_INFO_ID = T2.DISAB_INFO_ID
-- T7.MODE_NAME svrModelName, LEFT JOIN CH_SRV_ORGAN T5 ON T6.SRV_ORGAN_ID = T5.SRV_ORGAN_ID
DECODE(T1.SRV_MODE_ID, '1','医疗','2', '养老','3','上门', '4', '异地') srvModeName, left join CH_DISABLE_APPLY apply on apply.APPLY_ID = T2.APPLY_ID
T5.SRV_ORGAN_NAME svrOrganName, left join CH_DISABLE_EXIT
T1.PROG_STATUS progStatus, e on e.DISAB_INFO_ID = T2.DISAB_INFO_ID
T1.EFF_TIME effTime, group by T2.DISAB_INFO_ID,T2.REAL_NAME)
T2.CERTI_CODE certiCode, select t.*, ( case when t.exitReasonId is null then null else 1 end ) exitFlag from bb t
T2.APPLY_ID applyId, <where>
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 T1.SRV_ORGAN_ID = T5.SRV_ORGAN_ID
<where>
1=1 1=1
<if test="srvOrganId != null and srvOrganId != '' and srvOrganId!=0"> <if test="srvOrganId != null and srvOrganId != '' and srvOrganId!=0">
and T1.SRV_ORGAN_ID = #{srvOrganId} and t.srvOrganId = #{srvOrganId}
</if> </if>
<if test="certiCode != null and certiCode != ''"> <if test="certiCode != null and certiCode != ''">
and T2.CERTI_CODE = #{certiCode} and t.CERTI_CODE = #{certiCode}
</if> </if>
<if test="realName != null and realName != ''"> <if test="realName != null and realName != ''">
and T2.real_name like CONCAT(CONCAT('%',#{realName}) ,'%') and t.realName like CONCAT(CONCAT('%',#{realName}) ,'%')
</if> </if>
<if test="svrModelId != null and svrModelId != ''"> <if test="svrModelId != null and svrModelId != ''">
and T1.SRV_MODE_ID = #{svrModelId} and t.svrModelId = #{svrModelId}
</if> </if>
</where> </where>
...@@ -115,5 +102,10 @@ ...@@ -115,5 +102,10 @@
<![CDATA[ t.PROG_STATUS<> 2 ]]> order by t.FCD desc <![CDATA[ t.PROG_STATUS<> 2 ]]> order by t.FCD desc
</select> </select>
<select id="selectSrvSend" resultType="java.lang.Integer">
select count(*) from CH_SRV_SEND t where t.DISAB_INFO_ID = #{disabInfoId} and
t.STATUS = 1
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -54,6 +54,8 @@ public class ChSrvProgram { ...@@ -54,6 +54,8 @@ public class ChSrvProgram {
*/ */
private Long endEmp; private Long endEmp;
private Long srvSendId;
/** /**
* 终止时间 * 终止时间
*/ */
......
...@@ -57,14 +57,7 @@ public class DisableInfoListVo { ...@@ -57,14 +57,7 @@ public class DisableInfoListVo {
*/ */
private String gender; private String gender;
/**
* 接收服务省市区
*/
private String acptProvincial;
private String acptCity;
private String acptArea;
private String acptStreet;
private String acptAddress;
/** /**
* 失能等级 * 失能等级
...@@ -119,4 +112,6 @@ public class DisableInfoListVo { ...@@ -119,4 +112,6 @@ public class DisableInfoListVo {
private String exitTime; private String exitTime;
private String applyTime;
} }
...@@ -81,6 +81,9 @@ public class ProgramDetailVo { ...@@ -81,6 +81,9 @@ public class ProgramDetailVo {
*/ */
private Long diseTypeS; private Long diseTypeS;
private Long srvSendId;
/** /**
* 家庭住址 * 家庭住址
*/ */
...@@ -147,4 +150,6 @@ public class ProgramDetailVo { ...@@ -147,4 +150,6 @@ public class ProgramDetailVo {
*/ */
private List<ChFndAttach> fileDataList; private List<ChFndAttach> fileDataList;
} }
package com.hungraim.ltc.governance.controller; package com.hungraim.ltc.governance.controller;
import cn.hutool.core.collection.CollectionUtil;
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.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hungraim.ltc.governance.dao.ChSrvProgramMapper;
import com.hungraim.ltc.governance.dao.ChSrvSendMapper; import com.hungraim.ltc.governance.dao.ChSrvSendMapper;
import com.hungraim.ltc.governance.dao.ChSrvTaskMapper;
import com.hungraim.ltc.governance.service.*; import com.hungraim.ltc.governance.service.*;
import com.hungraim.ltc.pojo.entity.account.ChPunchDetailsVO; import com.hungraim.ltc.pojo.entity.account.ChPunchDetailsVO;
import com.hungraim.ltc.pojo.entity.disable.ChDisableInfo; import com.hungraim.ltc.pojo.entity.disable.ChDisableInfo;
import com.hungraim.ltc.pojo.entity.disable.ChSrvOrgan; import com.hungraim.ltc.pojo.entity.disable.ChSrvOrgan;
import com.hungraim.ltc.pojo.entity.serviceManage.ChSrvProgram;
import com.hungraim.ltc.pojo.entity.serviceManage.ChSrvSend; import com.hungraim.ltc.pojo.entity.serviceManage.ChSrvSend;
import com.hungraim.ltc.pojo.vo.disable.ChSrvTaskDetailVo; import com.hungraim.ltc.pojo.vo.disable.ChSrvTaskDetailVo;
import com.hungraim.ltc.pojo.vo.disable.ChrSrvVo; import com.hungraim.ltc.pojo.vo.disable.ChrSrvVo;
import com.hungraim.ltc.pojo.vo.disable.PlaceOtherVO;
import com.hungraim.ltc.pojo.vo.disable.SearchDisableSimpleVo; import com.hungraim.ltc.pojo.vo.disable.SearchDisableSimpleVo;
import com.hungraim.ltc.pojo.vo.governance.*; import com.hungraim.ltc.pojo.vo.governance.*;
import com.hungraim.ltc.util.Result; 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 org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -52,7 +55,11 @@ public class BuildBedController { ...@@ -52,7 +55,11 @@ public class BuildBedController {
@Autowired @Autowired
private ChSrvSendMapper chSrvSendMapper; private ChSrvSendMapper chSrvSendMapper;
@Autowired
private ChSrvProgramMapper chSrvProgramMapper;
@Autowired
private ChSrvTaskMapper chSrvTaskMapper;
/** /**
* 建床管理列表 * 建床管理列表
...@@ -259,9 +266,9 @@ public class BuildBedController { ...@@ -259,9 +266,9 @@ public class BuildBedController {
List<ChSrvSend> chSrvSendsList = chSrvSendMapper.selectList(new LambdaQueryWrapper<ChSrvSend>() List<ChSrvSend> chSrvSendsList = chSrvSendMapper.selectList(new LambdaQueryWrapper<ChSrvSend>()
.eq(ChSrvSend::getDisabInfoId, disabInfoId) .eq(ChSrvSend::getDisabInfoId, disabInfoId)
.eq(ChSrvSend::getStatus, (short) 1)); .eq(ChSrvSend::getStatus, (short) 1));
/* if (chSrvSendsList.size() > 0) { if (chSrvSendsList.size() > 0) {
return Result.failed("已分配护理机构,请先终止或退出再操作"); return Result.failed("已分配护理机构,请先终止再操作");
}*/ }
Long srvModeId1 = chSrvSend.getSrvModeId(); Long srvModeId1 = chSrvSend.getSrvModeId();
if(srvModeId != srvModeId1.intValue()){ if(srvModeId != srvModeId1.intValue()){
...@@ -280,10 +287,10 @@ public class BuildBedController { ...@@ -280,10 +287,10 @@ public class BuildBedController {
chSrvSend.setStatus(Short.valueOf("1")); chSrvSend.setStatus(Short.valueOf("1"));
if (chrSrvVo.getSrvSendId() == null) { if (chrSrvVo.getSrvSendId() == null) {
sendService.insertSrvSend(chSrvSend); sendService.insertSrvSend(chSrvSend);
}else { }else {
chSrvSend.setSrvSendId(chrSrvVo.getSrvSendId()); chSrvSend.setSrvSendId(chrSrvVo.getSrvSendId());
chSrvSendMapper.updateSrvSendById(chSrvSend); chSrvSendMapper.updateSrvSendById(chSrvSend);
} }
} }
} else { } else {
...@@ -305,6 +312,34 @@ public class BuildBedController { ...@@ -305,6 +312,34 @@ public class BuildBedController {
chSrvSend.setStopTime(saveStopTime.getStopTime()); chSrvSend.setStopTime(saveStopTime.getStopTime());
chSrvSend.setStatus((short)2); chSrvSend.setStatus((short)2);
sendService.updateById(chSrvSend); sendService.updateById(chSrvSend);
//终止方案 终止计划
Long srvSendId = saveStopTime.getSrvSendId();
UpdateWrapper updateWrapper1 = new UpdateWrapper();
updateWrapper1.eq("srv_send_id", srvSendId);
updateWrapper1.set("prog_status", 2);
updateWrapper1.set("LCD", new DATE());
updateWrapper1.set("end_reason", "服务分配终止");
chSrvProgramMapper.update(null,updateWrapper1);
List<ChSrvProgram> chSrvPrograms = chSrvProgramMapper.selectList(new LambdaQueryWrapper<ChSrvProgram>()
.eq(ChSrvProgram::getSrvSendId, srvSendId));
if(CollectionUtil.isNotEmpty(chSrvPrograms)){
Long programId = chSrvPrograms.get(0).getProgramId();
UpdateWrapper updateWrapper2 = new UpdateWrapper();
updateWrapper2.eq("program_id", programId);
updateWrapper2.set("status", 2);
updateWrapper2.set("LCD", new DATE());
updateWrapper2.set("end_reason", "服务分配终止");
chSrvTaskMapper.update(null,updateWrapper2);
}
// 终止时插入一条未分配记录
ChSrvSend chSrvSend1 = new ChSrvSend();
chSrvSend1.setStatus((short) 0);
chSrvSend1.setDisabInfoId(Long.valueOf(chSrvSend.getDisabInfoId()));
chSrvSend1.setFcd(new Date());
sendService.insertSrvSend(chSrvSend1);
return Result.success(true); return Result.success(true);
} }
......
package com.hungraim.ltc.governance.service.impl; package com.hungraim.ltc.governance.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
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;
import com.hungraim.ltc.governance.dao.ChSrvProgramMapper; import com.hungraim.ltc.governance.dao.ChSrvProgramMapper;
import com.hungraim.ltc.governance.dao.ChSrvProgramSetMapper; import com.hungraim.ltc.governance.dao.ChSrvProgramSetMapper;
import com.hungraim.ltc.governance.dao.ChSrvSendMapper; import com.hungraim.ltc.governance.dao.ChSrvSendMapper;
import com.hungraim.ltc.governance.dao.ChSrvTaskMapper;
import com.hungraim.ltc.governance.service.SrvProgramService; import com.hungraim.ltc.governance.service.SrvProgramService;
import com.hungraim.ltc.pojo.entity.SysConfig.ChFndAttach; import com.hungraim.ltc.pojo.entity.SysConfig.ChFndAttach;
import com.hungraim.ltc.pojo.entity.serviceManage.ChSrvProgram; import com.hungraim.ltc.pojo.entity.serviceManage.ChSrvProgram;
...@@ -19,6 +21,7 @@ import com.hungraim.ltc.util.AttachType; ...@@ -19,6 +21,7 @@ import com.hungraim.ltc.util.AttachType;
import com.hungraim.ltc.util.Result; 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 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;
...@@ -43,6 +46,9 @@ public class SrvProgramServiceImpl implements SrvProgramService { ...@@ -43,6 +46,9 @@ public class SrvProgramServiceImpl implements SrvProgramService {
@Autowired @Autowired
private AttachFeignService attachFeignService; private AttachFeignService attachFeignService;
@Autowired
private ChSrvTaskMapper chSrvTaskMapper;
@Override @Override
public Page<SvrSendListVo> getProgramList(Page<SvrSendListVo> page, Long srvOrganId, String realName, String realTel, String programStatus) { public Page<SvrSendListVo> getProgramList(Page<SvrSendListVo> page, Long srvOrganId, String realName, String realTel, String programStatus) {
return chSrvSendMapper.selectSrvSendList(page, srvOrganId, realName, realTel, programStatus); return chSrvSendMapper.selectSrvSendList(page, srvOrganId, realName, realTel, programStatus);
...@@ -97,6 +103,7 @@ public class SrvProgramServiceImpl implements SrvProgramService { ...@@ -97,6 +103,7 @@ public class SrvProgramServiceImpl implements SrvProgramService {
chSrvProgram.setProgStatus(0); chSrvProgram.setProgStatus(0);
chSrvProgram.setChargeType(0L); chSrvProgram.setChargeType(0L);
chSrvProgram.setEffTime(date); chSrvProgram.setEffTime(date);
chSrvProgram.setSrvSendId(programDetailVo.getSrvSendId());
chSrvProgramMapper.insert(chSrvProgram); chSrvProgramMapper.insert(chSrvProgram);
programId = chSrvProgram.getProgramId(); programId = chSrvProgram.getProgramId();
// 2.使用服务方案记录的id来添加服务方案项目记录 // 2.使用服务方案记录的id来添加服务方案项目记录
...@@ -150,7 +157,15 @@ public class SrvProgramServiceImpl implements SrvProgramService { ...@@ -150,7 +157,15 @@ public class SrvProgramServiceImpl implements SrvProgramService {
chSrvProgram.setProgramId(programId); chSrvProgram.setProgramId(programId);
chSrvProgram.setEndReason(endReason); chSrvProgram.setEndReason(endReason);
chSrvProgram.setProgStatus(2); chSrvProgram.setProgStatus(2);
chSrvProgramMapper.updateById(chSrvProgram); int updateCount = chSrvProgramMapper.updateById(chSrvProgram);
if(updateCount > 0 ) {
UpdateWrapper updateWrapper2 = new UpdateWrapper();
updateWrapper2.eq("program_id", programId);
updateWrapper2.set("status", 2);
updateWrapper2.set("LCD", new DATE());
updateWrapper2.set("end_reason", "服务方案终止");
chSrvTaskMapper.update(null, updateWrapper2);
}
} }
@Override @Override
......
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