Commit 14c96ea0 authored by zhangch's avatar zhangch

建床管理相关

parent 8d18a253
package com.hungraim.ltc.pojo.vo.governance;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
/**
......@@ -9,7 +10,8 @@ import lombok.Data;
public class BuildBedSearchRsp {
private String buildBedId;
private String provinceCity;
private String districtProvincial;
private String districtCity;
private String realName;
private String certiCode;
private String tel;
......@@ -21,7 +23,9 @@ public class BuildBedSearchRsp {
private String changhuNo;
private String specialZone;
private String bedNumber;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private String buildBedTime;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private String removeBedTime;
private String status;
}
......@@ -72,7 +72,7 @@ public class BuildBedController {
//家庭住址
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);
}
......@@ -80,7 +80,7 @@ public class BuildBedController {
//长护号
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);
}
......@@ -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")
......@@ -202,7 +214,7 @@ public class BuildBedController {
if (StringUtils.isBlank(realName) || null == srvOrganId) {
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);
}
}
......
......@@ -3,7 +3,6 @@ package com.hungraim.ltc.governance.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
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.ChSrvOrgan;
import com.hungraim.ltc.pojo.entity.serviceManage.ChSrvSend;
......@@ -81,7 +80,9 @@ public interface SrvSendMapper extends BaseMapper<ChSrvSend> {
" FROM " +
"CH_SRV_SEND t1" +
" 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 " +
"t3.BUILD_BED_ID IS NOT NULL " +
"t1.SRV_ORGAN_ID = #{srvOrganId} " +
" AND t2.REAL_NAME LIKE CONCAT( '%', CONCAT( #{realName}, '%' ) )")
IPage<SearchDisableSimpleVo> buildBedSearchByRealName(Page<SearchDisableSimpleVo> page, Integer srvOrganId, String realName);
......
......@@ -14,4 +14,12 @@ public interface IBuildBedService extends IService<ChSrvBuildBed> {
void saveOrUpdateBuildBed(BuildBedDetailVo buildBedDetailVo);
/**
* 查询建床详情
*
* @param buildBedId 建床详情id
* @return 返回建床详情
*/
BuildBedDetailVo getBuildBedDetail(Integer buildBedId);
}
......@@ -12,6 +12,7 @@ import com.hungraim.ltc.pojo.vo.governance.BuildBedSearchReq;
import com.hungraim.ltc.pojo.vo.system.AttachUpdateVo;
import com.hungraim.ltc.util.AttachType;
import com.hungraim.ltc.util.Result;
import com.hungraim.ltc.util.ResultCode;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
......@@ -47,14 +48,34 @@ public class BuildBedServiceImpl extends ServiceImpl<BuildBedMapper, ChSrvBuildB
List<ChFndAttach> fileDataList = buildBedDetailVo.getFileDataList();
chSrvBuildBed.setStatus(0); // 状态(0已建床,1已撤床)
chSrvBuildBed.setAccountStatus(0); // 结算状态(0,未结算;1,结算中;2,已结算)
this.saveOrUpdate(chSrvBuildBed);
buildBedDetailVo.setBuildBedId(chSrvBuildBed.getBuildBedId());
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来修改附件数据
*
* @param buildBedDetailVo
* @param buildBedDetailVo 建床详情封装对象
*/
private void updateAttachs(BuildBedDetailVo buildBedDetailVo) {
// zhangch 20210525 新增附件修改逻辑
......
......@@ -61,7 +61,7 @@ public class SrvSendServiceImpl extends ServiceImpl<SrvSendMapper, ChSrvSend> im
@Override
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 @@
<select id="searchOrgBed" parameterType="com.hungraim.ltc.pojo.vo.governance.BuildBedSearchReq"
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,
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,
......
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