Commit 14c96ea0 authored by zhangch's avatar zhangch

建床管理相关

parent 8d18a253
package com.hungraim.ltc.pojo.vo.governance; package com.hungraim.ltc.pojo.vo.governance;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data; import lombok.Data;
/** /**
...@@ -9,7 +10,8 @@ import lombok.Data; ...@@ -9,7 +10,8 @@ import lombok.Data;
public class BuildBedSearchRsp { public class BuildBedSearchRsp {
private String buildBedId; private String buildBedId;
private String provinceCity; private String districtProvincial;
private String districtCity;
private String realName; private String realName;
private String certiCode; private String certiCode;
private String tel; private String tel;
...@@ -21,7 +23,9 @@ public class BuildBedSearchRsp { ...@@ -21,7 +23,9 @@ public class BuildBedSearchRsp {
private String changhuNo; private String changhuNo;
private String specialZone; private String specialZone;
private String bedNumber; private String bedNumber;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private String buildBedTime; private String buildBedTime;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private String removeBedTime; private String removeBedTime;
private String status; private String status;
} }
...@@ -72,7 +72,7 @@ public class BuildBedController { ...@@ -72,7 +72,7 @@ public class BuildBedController {
//家庭住址 //家庭住址
return Result.failed(ResultCode.REQUEST_PARAM_ERROR); return Result.failed(ResultCode.REQUEST_PARAM_ERROR);
} }
if (buildBedDetailVo.getNursingDemandLevel() != null && buildBedDetailVo.getNursingDemandLevel() >= 1 && buildBedDetailVo.getNursingDemandLevel() <= 5) { if (buildBedDetailVo.getNursingDemandLevel() == null || buildBedDetailVo.getNursingDemandLevel() < 1 || buildBedDetailVo.getNursingDemandLevel() > 5) {
//护理需求等级 //护理需求等级
return Result.failed(ResultCode.REQUEST_PARAM_ERROR); return Result.failed(ResultCode.REQUEST_PARAM_ERROR);
} }
...@@ -80,7 +80,7 @@ public class BuildBedController { ...@@ -80,7 +80,7 @@ public class BuildBedController {
//长护号 //长护号
return Result.failed(ResultCode.REQUEST_PARAM_ERROR); return Result.failed(ResultCode.REQUEST_PARAM_ERROR);
} }
if (buildBedDetailVo.getGuaranteeMode() != null && buildBedDetailVo.getGuaranteeMode() >= 1 && buildBedDetailVo.getGuaranteeMode() <= 3) { if (buildBedDetailVo.getGuaranteeMode() == null || buildBedDetailVo.getGuaranteeMode() < 1 || buildBedDetailVo.getGuaranteeMode() > 3) {
//保障方式 //保障方式
return Result.failed(ResultCode.REQUEST_PARAM_ERROR); return Result.failed(ResultCode.REQUEST_PARAM_ERROR);
} }
...@@ -89,6 +89,18 @@ public class BuildBedController { ...@@ -89,6 +89,18 @@ public class BuildBedController {
} }
/** /**
* 查询建床详情
*
* @param buildBedId 建床详情id
* @return 返回建床详情
*/
@GetMapping("getBuildBedDetail")
public Result<BuildBedDetailVo> getBuildBedDetail(Integer buildBedId) {
BuildBedDetailVo buildBedDetailVo = buildBedService.getBuildBedDetail(buildBedId);
return Result.success(buildBedDetailVo);
}
/**
* 功能描述: 服务分配信息检索条件查询 * 功能描述: 服务分配信息检索条件查询
*/ */
@PostMapping("/pageFuwuCondition") @PostMapping("/pageFuwuCondition")
...@@ -202,7 +214,7 @@ public class BuildBedController { ...@@ -202,7 +214,7 @@ public class BuildBedController {
if (StringUtils.isBlank(realName) || null == srvOrganId) { if (StringUtils.isBlank(realName) || null == srvOrganId) {
return Result.failed(ResultCode.REQUEST_PARAM_ERROR); return Result.failed(ResultCode.REQUEST_PARAM_ERROR);
} }
IPage<SearchDisableSimpleVo> searchDisableSimpleVoIPage = sendService.buildBedSearchByRealName(pageNum, pageSize,srvOrganId, realName); IPage<SearchDisableSimpleVo> searchDisableSimpleVoIPage = sendService.buildBedSearchByRealName(pageNum, pageSize, srvOrganId, realName);
return Result.success(searchDisableSimpleVoIPage); return Result.success(searchDisableSimpleVoIPage);
} }
} }
......
...@@ -3,7 +3,6 @@ package com.hungraim.ltc.governance.dao; ...@@ -3,7 +3,6 @@ package com.hungraim.ltc.governance.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
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.pojo.entity.assessment.ChAprTask;
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.ChSrvSend; import com.hungraim.ltc.pojo.entity.serviceManage.ChSrvSend;
...@@ -81,7 +80,9 @@ public interface SrvSendMapper extends BaseMapper<ChSrvSend> { ...@@ -81,7 +80,9 @@ public interface SrvSendMapper extends BaseMapper<ChSrvSend> {
" FROM " + " FROM " +
"CH_SRV_SEND t1" + "CH_SRV_SEND t1" +
" LEFT JOIN CH_DISABLE_INFO t2 ON t1.DISAB_INFO_ID = t2.DISAB_INFO_ID " + " LEFT JOIN CH_DISABLE_INFO t2 ON t1.DISAB_INFO_ID = t2.DISAB_INFO_ID " +
" LEFT JOIN CH_SRV_BUILD_BED t3 ON t2.DISAB_INFO_ID = t3.DISAB_INFO_ID " +
" WHERE " + " WHERE " +
"t3.BUILD_BED_ID IS NOT NULL " +
"t1.SRV_ORGAN_ID = #{srvOrganId} " + "t1.SRV_ORGAN_ID = #{srvOrganId} " +
" AND t2.REAL_NAME LIKE CONCAT( '%', CONCAT( #{realName}, '%' ) )") " AND t2.REAL_NAME LIKE CONCAT( '%', CONCAT( #{realName}, '%' ) )")
IPage<SearchDisableSimpleVo> buildBedSearchByRealName(Page<SearchDisableSimpleVo> page, Integer srvOrganId, String realName); IPage<SearchDisableSimpleVo> buildBedSearchByRealName(Page<SearchDisableSimpleVo> page, Integer srvOrganId, String realName);
......
...@@ -14,4 +14,12 @@ public interface IBuildBedService extends IService<ChSrvBuildBed> { ...@@ -14,4 +14,12 @@ public interface IBuildBedService extends IService<ChSrvBuildBed> {
void saveOrUpdateBuildBed(BuildBedDetailVo buildBedDetailVo); void saveOrUpdateBuildBed(BuildBedDetailVo buildBedDetailVo);
/**
* 查询建床详情
*
* @param buildBedId 建床详情id
* @return 返回建床详情
*/
BuildBedDetailVo getBuildBedDetail(Integer buildBedId);
} }
...@@ -12,6 +12,7 @@ import com.hungraim.ltc.pojo.vo.governance.BuildBedSearchReq; ...@@ -12,6 +12,7 @@ import com.hungraim.ltc.pojo.vo.governance.BuildBedSearchReq;
import com.hungraim.ltc.pojo.vo.system.AttachUpdateVo; import com.hungraim.ltc.pojo.vo.system.AttachUpdateVo;
import com.hungraim.ltc.util.AttachType; 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 lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
...@@ -47,14 +48,34 @@ public class BuildBedServiceImpl extends ServiceImpl<BuildBedMapper, ChSrvBuildB ...@@ -47,14 +48,34 @@ public class BuildBedServiceImpl extends ServiceImpl<BuildBedMapper, ChSrvBuildB
List<ChFndAttach> fileDataList = buildBedDetailVo.getFileDataList(); List<ChFndAttach> fileDataList = buildBedDetailVo.getFileDataList();
chSrvBuildBed.setStatus(0); // 状态(0已建床,1已撤床) chSrvBuildBed.setStatus(0); // 状态(0已建床,1已撤床)
chSrvBuildBed.setAccountStatus(0); // 结算状态(0,未结算;1,结算中;2,已结算) chSrvBuildBed.setAccountStatus(0); // 结算状态(0,未结算;1,结算中;2,已结算)
this.saveOrUpdate(chSrvBuildBed);
buildBedDetailVo.setBuildBedId(chSrvBuildBed.getBuildBedId());
this.updateAttachs(buildBedDetailVo); this.updateAttachs(buildBedDetailVo);
} }
@Override
public BuildBedDetailVo getBuildBedDetail(Integer buildBedId) {
ChSrvBuildBed chSrvBuildBed = this.getById(buildBedId);
BuildBedDetailVo buildBedDetailVo = new BuildBedDetailVo();
BeanUtils.copyProperties(chSrvBuildBed, buildBedDetailVo);
try {
Result<List<ChFndAttach>> result = attachFeignService.selectAttachs(buildBedId.longValue(), AttachType.BUILD_BED.getUploadType());
if (ResultCode.SUCCESS.getCode().equals(result.getCode())) {
buildBedDetailVo.setFileDataList(result.getData());
} else {
log.error("请求获取建床附件失败:{}", result.getMsg());
}
} catch (Exception e) {
e.printStackTrace();
log.error("请求获取建床附件失败:{}", e.getMessage());
}
return buildBedDetailVo;
}
/** /**
* 调用feign api来修改附件数据 * 调用feign api来修改附件数据
* *
* @param buildBedDetailVo * @param buildBedDetailVo 建床详情封装对象
*/ */
private void updateAttachs(BuildBedDetailVo buildBedDetailVo) { private void updateAttachs(BuildBedDetailVo buildBedDetailVo) {
// zhangch 20210525 新增附件修改逻辑 // zhangch 20210525 新增附件修改逻辑
......
...@@ -61,7 +61,7 @@ public class SrvSendServiceImpl extends ServiceImpl<SrvSendMapper, ChSrvSend> im ...@@ -61,7 +61,7 @@ public class SrvSendServiceImpl extends ServiceImpl<SrvSendMapper, ChSrvSend> im
@Override @Override
public IPage<SearchDisableSimpleVo> buildBedSearchByRealName(Integer pageNum, Integer pageSize, Integer srvOrganId, String realName) { public IPage<SearchDisableSimpleVo> buildBedSearchByRealName(Integer pageNum, Integer pageSize, Integer srvOrganId, String realName) {
return sendMapper.buildBedSearchByRealName(new Page<SearchDisableSimpleVo>(pageNum, pageSize), srvOrganId, realName); return sendMapper.buildBedSearchByRealName(new Page<>(pageNum, pageSize), srvOrganId, realName);
} }
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<select id="searchOrgBed" parameterType="com.hungraim.ltc.pojo.vo.governance.BuildBedSearchReq" <select id="searchOrgBed" parameterType="com.hungraim.ltc.pojo.vo.governance.BuildBedSearchReq"
resultType="com.hungraim.ltc.pojo.vo.governance.BuildBedSearchRsp"> resultType="com.hungraim.ltc.pojo.vo.governance.BuildBedSearchRsp">
SELECT a.BUILD_BED_ID, CONCAT(b.DISTRICT_PROVINCIAL, b.DISTRICT_CITY) AS province_city, b.REAL_NAME, SELECT a.BUILD_BED_ID, b.DISTRICT_PROVINCIAL, b.DISTRICT_CITY, b.REAL_NAME,
b.CERTI_CODE, b.TEL, TRUNC(months_between(sysdate, b.BIRTHDAY)/12) AS age, b.CERTI_CODE, b.TEL, TRUNC(months_between(sysdate, b.BIRTHDAY)/12) AS age,
DECODE(b.GENDER, 'M','男','F', '女') gender, a.ADRESS_DETAIL as address, DECODE(b.GENDER, 'M','男','F', '女') gender, a.ADRESS_DETAIL as address,
a.NURSING_DEMAND_LEVEL, a.SRV_MODE, a.CHANGHU_NO, a.SPECIAL_ZONE, a.BED_NUMBER, TO_CHAR(a.BUILD_BED_TIME, 'yyyy-MM-dd') AS build_bed_time, a.NURSING_DEMAND_LEVEL, a.SRV_MODE, a.CHANGHU_NO, a.SPECIAL_ZONE, a.BED_NUMBER, TO_CHAR(a.BUILD_BED_TIME, 'yyyy-MM-dd') AS build_bed_time,
......
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