Commit fa469c05 authored by 蔡镇泽's avatar 蔡镇泽

建床管理接口调整

parent 0d7dbd3f
...@@ -44,13 +44,48 @@ public class BuildBedController { ...@@ -44,13 +44,48 @@ public class BuildBedController {
@Autowired @Autowired
private DisableInfoServie disableInfoServie; private DisableInfoServie disableInfoServie;
/**
* 建床管理列表
*/
@PostMapping("/searchOrgBed") @PostMapping("/searchOrgBed")
public Result searchOrgBed(@RequestBody BuildBedSearchReq req) { public Result searchOrgBed(@RequestBody BuildBedSearchReq req) {
return buildBedService.searchOrgBed(req); return buildBedService.searchOrgBed(req);
} }
/**
* 建床管理新增
*/
@PostMapping("/addBuild") @PostMapping("/addBuild")
public Result<Boolean> buildBed(ChSrvBuildBed buildBed) { public Result<Boolean> buildBed(ChSrvBuildBed buildBed) {
/*if (StringUtils.isBlank(buildBed.getRealName())) {
//姓名
return Result.failed(ResultCode.REQUEST_PARAM_ERROR);
}
if (StringUtils.isBlank(buildBed.getGender())) {
//性别
return Result.failed(ResultCode.REQUEST_PARAM_ERROR);
}
if (StringUtils.isBlank(buildBed.getCertiCode())) {
//身份证号
return Result.failed(ResultCode.REQUEST_PARAM_ERROR);
}
if (StringUtils.isBlank(buildBed.getAdressDetail())) {
//家庭住址
return Result.failed(ResultCode.REQUEST_PARAM_ERROR);
}
if (buildBed.getNursingDemandLevel() != null && buildBed.getNursingDemandLevel() >= 1 && buildBed.getNursingDemandLevel() <= 5) {
//护理需求等级
return Result.failed(ResultCode.REQUEST_PARAM_ERROR);
}
if (StringUtils.isBlank(buildBed.getChanghuNo())) {
//长护号
return Result.failed(ResultCode.REQUEST_PARAM_ERROR);
}
if (buildBed.getGuaranteeMode() != null && buildBed.getGuaranteeMode() >= 1 && buildBed.getGuaranteeMode() <= 3) {
//保障方式
return Result.failed(ResultCode.REQUEST_PARAM_ERROR);
}*/
buildBed.setRecordTime(new Date());//建床时间
boolean b = buildBedService.save(buildBed); boolean b = buildBedService.save(buildBed);
return Result.success(b); return Result.success(b);
} }
...@@ -111,14 +146,14 @@ public class BuildBedController { ...@@ -111,14 +146,14 @@ public class BuildBedController {
} }
/** /**
*已分配护理机构信息查询 * 已分配护理机构信息查询
*/ */
@PostMapping("/querySrvYet") @PostMapping("/querySrvYet")
public Result querySrvYet(DisableInfoVo disableInfoVo){ public Result querySrvYet(DisableInfoVo disableInfoVo) {
if (StrUtil.isBlankIfStr(disableInfoVo.getDisableInfoId())){ if (StrUtil.isBlankIfStr(disableInfoVo.getDisableInfoId())) {
return Result.failed("失能人员id不能为空"); return Result.failed("失能人员id不能为空");
} }
Page<DisableInfoVo> disableInfoVos = disableInfoServie.querySrvYet(disableInfoVo.getDisableInfoId(),disableInfoVo.getCurrent(),disableInfoVo.getLimit()); Page<DisableInfoVo> disableInfoVos = disableInfoServie.querySrvYet(disableInfoVo.getDisableInfoId(), disableInfoVo.getCurrent(), disableInfoVo.getLimit());
long total = disableInfoVos.getTotal(); long total = disableInfoVos.getTotal();
List<DisableInfoVo> records = disableInfoVos.getRecords(); List<DisableInfoVo> records = disableInfoVos.getRecords();
Map map = new HashMap<>(); Map map = new HashMap<>();
...@@ -138,14 +173,14 @@ public class BuildBedController { ...@@ -138,14 +173,14 @@ public class BuildBedController {
for (ChSrvSend chSrvSend : chSrvSends) { for (ChSrvSend chSrvSend : chSrvSends) {
disabInfoId = chSrvSend.getDisabInfoId(); disabInfoId = chSrvSend.getDisabInfoId();
// 判斷參數是否存在 // 判斷參數是否存在
if (chSrvSend.getDisabInfoId()==null || chSrvSend.getSrvOrganId()==null || chSrvSend.getSrvModeId()==null) { if (chSrvSend.getDisabInfoId() == null || chSrvSend.getSrvOrganId() == null || chSrvSend.getSrvModeId() == null) {
return Result.failed("参数不全!"); return Result.failed("参数不全!");
} }
chSrvSend.setAllotTime(new Date()); chSrvSend.setAllotTime(new Date());
chSrvSend.setStatus(Short.valueOf("1")); chSrvSend.setStatus(Short.valueOf("1"));
if(chrSrvVo.getSrvSendId() == null){ if (chrSrvVo.getSrvSendId() == null) {
Long id = sendService.selectMaxId(); Long id = sendService.selectMaxId();
if(id == null){ if (id == null) {
id = 0L; id = 0L;
} }
chSrvSend.setSrvSendId(++id); chSrvSend.setSrvSendId(++id);
...@@ -158,7 +193,5 @@ public class BuildBedController { ...@@ -158,7 +193,5 @@ public class BuildBedController {
return Result.success(); return Result.success();
} }
} }
...@@ -14,6 +14,8 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -14,6 +14,8 @@ import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource; import javax.annotation.Resource;
/** /**
* 撤床
*
* @author jiaguokai * @author jiaguokai
*/ */
@RestController @RestController
...@@ -25,13 +27,18 @@ public class RemoveBedController { ...@@ -25,13 +27,18 @@ public class RemoveBedController {
@Resource @Resource
private IBuildBedService buildBedService; private IBuildBedService buildBedService;
@PostMapping("/") /**
* 撤床
*/
@PostMapping("/revokeBuild")
public Result removeOne(ChSrvRemoveBed removeBed) { public Result removeOne(ChSrvRemoveBed removeBed) {
Boolean result = removeBedService.save(removeBed);
if (result) {
Integer buildBedId = removeBed.getBuildBedId(); Integer buildBedId = removeBed.getBuildBedId();
buildBedService.update(new LambdaUpdateWrapper<ChSrvBuildBed>().eq(ChSrvBuildBed::getBuildBedId, buildBedId).set(ChSrvBuildBed::getStatus, 1)); boolean update = buildBedService.update(new LambdaUpdateWrapper<ChSrvBuildBed>().eq(ChSrvBuildBed::getBuildBedId, buildBedId).set(ChSrvBuildBed::getStatus, 1));
result = update;
return Result.success(removeBedService.removeOne(removeBed)); }
return Result.success(result);
} }
} }
...@@ -6,7 +6,6 @@ import com.hungraim.ltc.governance.dao.RemoveBedMapper; ...@@ -6,7 +6,6 @@ import com.hungraim.ltc.governance.dao.RemoveBedMapper;
import com.hungraim.ltc.governance.service.IRemoveBedService; import com.hungraim.ltc.governance.service.IRemoveBedService;
import com.hungraim.ltc.pojo.entity.governance.ChSrvRemoveBed; import com.hungraim.ltc.pojo.entity.governance.ChSrvRemoveBed;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
...@@ -26,8 +25,6 @@ public class RemoveBedServiceImpl extends ServiceImpl<RemoveBedMapper, ChSrvRemo ...@@ -26,8 +25,6 @@ public class RemoveBedServiceImpl extends ServiceImpl<RemoveBedMapper, ChSrvRemo
@Override @Override
public Integer removeOne(ChSrvRemoveBed removeBed) { public Integer removeOne(ChSrvRemoveBed removeBed) {
return null; return null;
} }
} }
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