Commit df9910ab authored by 贾国凯's avatar 贾国凯

管控服务相关

parent 9988a33b
package com.hungraim.ism.pojo.entity.governance;
package com.hungraim.ltc.pojo.entity.governance;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
......@@ -11,32 +11,116 @@ import java.util.Date;
@Data
@TableName("CH_SRV_REMOVE_BED")
public class ChSrvRemoveBed {
/**
* 撤床ID
*/
private Integer removeBedId;
/**
* 护理机构ID
*/
private Integer srvOrganId;
/**
* 失能人员ID
*/
private Integer disabInfoId;
/**
* 建床ID
*/
private Integer buildBedId;
/**
* 方案ID
*/
private Integer programId;
/**
* 姓名
*/
private String realName;
/**
* 性别(男:M;女:F;不确定 N)
*/
private String gender;
/**
* 出生年月日
*/
private Date birthday;
/**
* 手机号
*/
private String tel;
/**
* 评定等级(1:1级,2:2级,3:3级,4:4级,5:5级)
*/
private Integer rating;
/**
* 保障方式(1:院护,2:专户,3:巡护)
*/
private Integer guaranteeMode;
/**
* 建床日期
*/
private Date buildBedTime;
/**
* 专区
*/
private String specialZone;
/**
* 长护号
*/
private String changhuNo;
/**
* 床号
*/
private String bedNumber;
/**
* 撤床日期
*/
private Date removeBedTime;
/**
* 在床天数
*/
private Integer bedDays;
/**
* 诊断
*/
private String diagnosis;
/**
* 建床情况
*/
private String bedConstruction;
/**
* 护理经过
*/
private String nursingProcess;
/**
* 撤床原因(1好转、2不再符合条件,3转换保障方式,4加重、5转住院治疗,6对机构服务不满意,7更换医护机构,8对政策原因不满,9死亡、10撤床,11其他原因)
*/
private Integer removeBedReason;
/**
* 撤床后建议
*/
private String removeBedProposal;
/**
* 状态(0有效,1失效)
*/
private Integer status;
/**
* 首次操作时间
*/
private Date fcd;
/**
* 首次操作人
*/
private Integer fcu;
/**
* 末次操作时间
*/
private Date lcd;
/**
* 末次操作人
*/
private Integer lcu;
/**
* 撤床备注
*/
private String removeBedReasonRemarks;
}
package com.hungraim.ltc.pojo.vo.governance;
import lombok.Data;
/**
* @author jiaguokai
*/
@Data
public class BuildBedSearchReq {
private Integer pageNum;
private Integer pageSize;
/**
* 护理机构ID
*/
private Integer srvOrganId;
/**
* 姓名
*/
private String realName;
/**
* 身份证号码
*/
private String certiCode;
/**
* 状态(0已建床,1已撤床,2-全部)
*/
private Integer status;
}
package com.hungraim.ltc.pojo.vo.governance;
import lombok.Data;
/**
* @author jiaguokai
*/
@Data
public class BuildBedSearchRsp {
private String buildBedId;
private String provinceCity;
private String realName;
private String certiCode;
private String tel;
private String age;
private String gender;
private String address;
private String nursingDemandLevel;
private String srvMode;
private String changhuNo;
private String specialZone;
private String bedNumber;
private String buildBedTime;
private String removeBedTime;
private String status;
}
......@@ -31,7 +31,7 @@
<!--基础包-->
<dependency>
<groupId>com.hungraim.ism</groupId>
<groupId>com.hungraim.ltc</groupId>
<artifactId>common-core</artifactId>
<version>0.0.1</version>
<exclusions>
......@@ -54,12 +54,12 @@
</exclusions>
</dependency>
<dependency>
<groupId>com.hungraim.ism</groupId>
<groupId>com.hungraim.ltc</groupId>
<artifactId>common-mybatis</artifactId>
<version>0.0.1</version>
</dependency>
<dependency>
<groupId>com.hungraim.ism</groupId>
<groupId>com.hungraim.ltc</groupId>
<artifactId>common-redis</artifactId>
<version>0.0.1</version>
</dependency>
......
package com.hungraim.ch.governance;
package com.hungraim.ltc.governance;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
......
package com.hungraim.ltc.governance.controller;
import com.hungraim.ltc.governance.service.IBuildBedService;
import com.hungraim.ltc.pojo.entity.governance.ChSrvBuildBed;
import com.hungraim.ltc.pojo.vo.governance.BuildBedSearchReq;
import com.hungraim.ltc.util.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
/**
* @author jiaguokai
*/
@RestController
@RequestMapping("/api.governance/buildBed")
@Slf4j
public class BuildBedController {
@Resource
private IBuildBedService buildBedService;
@PostMapping("/searchOrgBed")
public Result searchOrgBed(@RequestBody BuildBedSearchReq req) {
return buildBedService.searchOrgBed(req);
}
@PostMapping("/addBuild")
public Result buildBed(ChSrvBuildBed buildBed) {
boolean b = buildBedService.save(buildBed);
return Result.success(b);
}
}
package com.hungraim.ltc.governance.controller;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.hungraim.ltc.governance.service.IBuildBedService;
import com.hungraim.ltc.governance.service.IRemoveBedService;
import com.hungraim.ltc.pojo.entity.governance.ChSrvBuildBed;
import com.hungraim.ltc.pojo.entity.governance.ChSrvRemoveBed;
import com.hungraim.ltc.util.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
/**
* @author jiaguokai
*/
@RestController
@RequestMapping("/api.governance/")
@Slf4j
public class RemoveBedController {
@Resource
private IRemoveBedService removeBedService;
@Resource
private IBuildBedService buildBedService;
@PostMapping("/")
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));
}
}
package com.hungraim.ltc.governance.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hungraim.ltc.pojo.entity.governance.ChSrvBuildBed;
import com.hungraim.ltc.pojo.vo.governance.BuildBedSearchReq;
import com.hungraim.ltc.pojo.vo.governance.BuildBedSearchRsp;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
/**
* @author jiaguokai
* ChSrvBuildBed
*/
@Mapper
@Repository
public interface BuildBedMapper extends BaseMapper<ChSrvBuildBed> {
Page<BuildBedSearchRsp> searchOrgBed(Page<BuildBedSearchRsp> page, @Param("req") BuildBedSearchReq req);
}
package com.hungraim.ltc.governance.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hungraim.ltc.pojo.entity.governance.ChSrvRemoveBed;
import org.apache.ibatis.annotations.Mapper;
/**
* @author jiaguokai
*/
@Mapper
public interface RemoveBedMapper extends BaseMapper<ChSrvRemoveBed> {
}
package com.hungraim.ltc.governance.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hungraim.ltc.pojo.entity.governance.ChSrvBuildBed;
import com.hungraim.ltc.pojo.vo.governance.BuildBedSearchReq;
import com.hungraim.ltc.util.Result;
/**
* @author jiaguokai
*/
public interface IBuildBedService extends IService<ChSrvBuildBed> {
Result searchOrgBed(BuildBedSearchReq req);
}
package com.hungraim.ltc.governance.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hungraim.ltc.pojo.entity.governance.ChSrvRemoveBed;
/**
* @author jiaguokai
*/
public interface IRemoveBedService extends IService<ChSrvRemoveBed> {
Integer removeOne(ChSrvRemoveBed removeBed);
}
package com.hungraim.ltc.governance.service.impl;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hungraim.ltc.governance.dao.BuildBedMapper;
import com.hungraim.ltc.governance.service.IBuildBedService;
import com.hungraim.ltc.pojo.entity.governance.ChSrvBuildBed;
import com.hungraim.ltc.pojo.vo.governance.BuildBedSearchReq;
import com.hungraim.ltc.util.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
/**
* @author jiaguokai
*/
@Slf4j
@Service
public class BuildBedServiceImpl extends ServiceImpl<BuildBedMapper, ChSrvBuildBed> implements IBuildBedService {
@Resource
private BuildBedMapper buildBedMapper;
@Override
public Result searchOrgBed(BuildBedSearchReq req) {
// QueryWrapper<ChSrvBuildBed> queryWrapper = new QueryWrapper<>();
// queryWrapper.eq("SRV_ORGAN_ID", req.getSrvOrganId());
// if (StrUtil.isNotBlank(req.getRealName())) {
// queryWrapper.like("REAL_NAME", req.getRealName());
// }
// if (StrUtil.isNotBlank(req.getCertiCode())) {
// queryWrapper.eq("CERTI_CODE", req.getCertiCode());
// }
// if (req.getStatus() != null && req.getStatus() != 2) {
// queryWrapper.eq("STATUS", req.getStatus());
// }
// Page<ChSrvBuildBed> page = buildBedMapper.selectPage(new Page<>(req.getPageNum(), req.getPageSize()), queryWrapper);
if (2 == req.getStatus()) {
req.setStatus(null);
}
Page page = buildBedMapper.searchOrgBed(new Page<>(req.getPageNum(), req.getPageSize()), req);
return Result.success(page);
}
}
package com.hungraim.ltc.governance.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hungraim.ltc.governance.dao.BuildBedMapper;
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;
/**
* @author jiaguokai
*/
@Service
@Slf4j
public class RemoveBedServiceImpl extends ServiceImpl<RemoveBedMapper, ChSrvRemoveBed> implements IRemoveBedService {
@Resource
private RemoveBedMapper removeBedMapper;
@Resource
private BuildBedMapper buildBedMapper;
@Override
public Integer removeOne(ChSrvRemoveBed removeBed) {
return null;
}
}
spring:
devtools:
restart:
enabled: true
additional-paths: src/main/java
application:
name: ISM-GOVERNANCE-SERVICE
name: LTC-GOVERNANCE-SERVICE
cloud:
nacos:
discovery:
......@@ -16,10 +15,10 @@ spring:
server-addr: qw.hungraim.com:31158
file-extension: yaml # 必须修改成yaml
extension-configs:
- data-id: ism-database.yaml
- data-id: ltc-database.yaml
group: common
refresh: true
- data-id: ism-basic.yaml
- data-id: ltc-basic.yaml
group: common
refresh: true
- data-id: thread-config.yaml
......@@ -31,3 +30,4 @@ server:
mybatis-plus:
configuration:
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
mapper-locations: classpath:com/hungraim/ltc/governance/mapper/*.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hungraim.ltc.governance.dao.BuildBedMapper">
<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,
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,
TO_CHAR((CASE a.STATUS WHEN 1 THEN (SELECT REMOVE_BED_TIME FROM CH_SRV_REMOVE_BED c WHERE c.BUILD_BED_ID=a.BUILD_BED_ID) ELSE NULL END), 'yyyy-MM-dd') AS remove_bed_time,
(CASE a.STATUS when 0 THEN '已建床' when 1 then '已撤床' end) AS status
FROM CH_SRV_BUILD_BED a, CH_DISABLE_INFO b where a.DISAB_INFO_ID = b.DISAB_INFO_ID
AND a.SRV_ORGAN_ID =#{req.srvOrganId}
<if test="req.realName != null and req.realName != ''">
AND upper(a.REAL_NAME) LIKE '%' || upper#{req.realName}) || '%'
</if>
<if test="req.certiCode != null and req.certiCode != ''">
AND upper(a.CERTI_CODE) = upper(#{req.certiCode})
</if>
<if test="req.status != null and req.status != '' ">
AND a.STATUS= #{req.status}
</if>
ORDER BY a.BUILD_BED_TIME DESC, a.CERTI_CODE DESC
</select>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hungraim.ltc.governance.dao.RemoveBedMapper">
</mapper>
\ No newline at end of file
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