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

建床管理接口调整

parent 0d7dbd3f
......@@ -44,13 +44,48 @@ public class BuildBedController {
@Autowired
private DisableInfoServie disableInfoServie;
/**
* 建床管理列表
*/
@PostMapping("/searchOrgBed")
public Result searchOrgBed(@RequestBody BuildBedSearchReq req) {
return buildBedService.searchOrgBed(req);
}
/**
* 建床管理新增
*/
@PostMapping("/addBuild")
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);
return Result.success(b);
}
......@@ -111,14 +146,14 @@ public class BuildBedController {
}
/**
*已分配护理机构信息查询
* 已分配护理机构信息查询
*/
@PostMapping("/querySrvYet")
public Result querySrvYet(DisableInfoVo disableInfoVo){
if (StrUtil.isBlankIfStr(disableInfoVo.getDisableInfoId())){
public Result querySrvYet(DisableInfoVo disableInfoVo) {
if (StrUtil.isBlankIfStr(disableInfoVo.getDisableInfoId())) {
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();
List<DisableInfoVo> records = disableInfoVos.getRecords();
Map map = new HashMap<>();
......@@ -131,21 +166,21 @@ public class BuildBedController {
* 提交分配机构
*/
@PostMapping("/submit")
public Result submit(ChrSrvVo chrSrvVo) {
public Result submit(ChrSrvVo chrSrvVo) {
List<ChSrvSend> chSrvSends = chrSrvVo.getChSrvSends();
if (chSrvSends != null && chSrvSends.size() > 0) {
Long disabInfoId = null;
for (ChSrvSend chSrvSend : chSrvSends) {
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("参数不全!");
}
chSrvSend.setAllotTime(new Date());
chSrvSend.setStatus(Short.valueOf("1"));
if(chrSrvVo.getSrvSendId() == null){
if (chrSrvVo.getSrvSendId() == null) {
Long id = sendService.selectMaxId();
if(id == null){
if (id == null) {
id = 0L;
}
chSrvSend.setSrvSendId(++id);
......@@ -158,7 +193,5 @@ public class BuildBedController {
return Result.success();
}
}
......@@ -14,6 +14,8 @@ import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
/**
* 撤床
*
* @author jiaguokai
*/
@RestController
......@@ -25,13 +27,18 @@ public class RemoveBedController {
@Resource
private IBuildBedService buildBedService;
@PostMapping("/")
/**
* 撤床
*/
@PostMapping("/revokeBuild")
public Result removeOne(ChSrvRemoveBed removeBed) {
Integer buildBedId = removeBed.getBuildBedId();
buildBedService.update(new LambdaUpdateWrapper<ChSrvBuildBed>().eq(ChSrvBuildBed::getBuildBedId, buildBedId).set(ChSrvBuildBed::getStatus, 1));
return Result.success(removeBedService.removeOne(removeBed));
Boolean result = removeBedService.save(removeBed);
if (result) {
Integer buildBedId = removeBed.getBuildBedId();
boolean update = buildBedService.update(new LambdaUpdateWrapper<ChSrvBuildBed>().eq(ChSrvBuildBed::getBuildBedId, buildBedId).set(ChSrvBuildBed::getStatus, 1));
result = update;
}
return Result.success(result);
}
}
......@@ -6,7 +6,6 @@ import com.hungraim.ltc.governance.dao.RemoveBedMapper;
import com.hungraim.ltc.governance.service.IRemoveBedService;
import com.hungraim.ltc.pojo.entity.governance.ChSrvRemoveBed;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
......@@ -26,8 +25,6 @@ public class RemoveBedServiceImpl extends ServiceImpl<RemoveBedMapper, ChSrvRemo
@Override
public Integer removeOne(ChSrvRemoveBed removeBed) {
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