diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtCateringDaoController.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtCateringDaoController.java new file mode 100644 index 000000000..d9ca38f36 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtCateringDaoController.java @@ -0,0 +1,110 @@ +package com.ruoyi.system.fantang.controller; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; + +import java.util.List; +import java.util.Arrays; + +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.ruoyi.common.utils.StringUtils; +import lombok.RequiredArgsConstructor; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.system.fantang.domain.FtCateringDao; +import com.ruoyi.system.fantang.service.IFtCateringDaoService; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.core.page.TableDataInfo; + +/** + * 配餐功能Controller + * + * @author ft + * @date 2020-12-07 + */ +@RequiredArgsConstructor(onConstructor_ = @Autowired) +@RestController +@RequestMapping("/fantang/catering" ) +public class FtCateringDaoController extends BaseController { + + private final IFtCateringDaoService iFtCateringDaoService; + + /** + * 查询配餐功能列表 + */ + @PreAuthorize("@ss.hasPermi('fantang:catering:list')") + @GetMapping("/list") + public TableDataInfo list(FtCateringDao ftCateringDao) + { + startPage(); + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(ftCateringDao); + if (ftCateringDao.getFlag() != null){ + lqw.eq(FtCateringDao::getFlag ,ftCateringDao.getFlag()); + } + List list = iFtCateringDaoService.list(lqw); + return getDataTable(list); + } + + /** + * 导出配餐功能列表 + */ + @PreAuthorize("@ss.hasPermi('fantang:catering:export')" ) + @Log(title = "配餐功能" , businessType = BusinessType.EXPORT) + @GetMapping("/export" ) + public AjaxResult export(FtCateringDao ftCateringDao) { + LambdaQueryWrapper lqw = new LambdaQueryWrapper(ftCateringDao); + List list = iFtCateringDaoService.list(lqw); + ExcelUtil util = new ExcelUtil(FtCateringDao. class); + return util.exportExcel(list, "catering" ); + } + + /** + * 获取配餐功能详细信息 + */ + @PreAuthorize("@ss.hasPermi('fantang:catering:query')" ) + @GetMapping(value = "/{id}" ) + public AjaxResult getInfo(@PathVariable("id" ) Long id) { + return AjaxResult.success(iFtCateringDaoService.getById(id)); + } + + /** + * 新增配餐功能 + */ + @PreAuthorize("@ss.hasPermi('fantang:catering:add')" ) + @Log(title = "配餐功能" , businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody FtCateringDao ftCateringDao) { + return toAjax(iFtCateringDaoService.save(ftCateringDao) ? 1 : 0); + } + + /** + * 修改配餐功能 + */ + @PreAuthorize("@ss.hasPermi('fantang:catering:edit')" ) + @Log(title = "配餐功能" , businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody FtCateringDao ftCateringDao) { + return toAjax(iFtCateringDaoService.updateById(ftCateringDao) ? 1 : 0); + } + + /** + * 删除配餐功能 + */ + @PreAuthorize("@ss.hasPermi('fantang:catering:remove')" ) + @Log(title = "配餐功能" , businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}" ) + public AjaxResult remove(@PathVariable Long[] ids) { + return toAjax(iFtCateringDaoService.removeByIds(Arrays.asList(ids)) ? 1 : 0); + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtPatientDaoController.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtPatientDaoController.java index 91e094fcf..7e5785e4e 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtPatientDaoController.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtPatientDaoController.java @@ -1,42 +1,35 @@ package com.ruoyi.system.fantang.controller; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; - -import java.util.Date; -import java.util.List; -import java.util.Arrays; - +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; -import com.ruoyi.common.utils.StringUtils; -import lombok.RequiredArgsConstructor; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; import com.ruoyi.common.annotation.Log; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.system.fantang.domain.FtPatientDao; import com.ruoyi.system.fantang.service.IFtPatientDaoService; -import com.ruoyi.common.utils.poi.ExcelUtil; -import com.ruoyi.common.core.page.TableDataInfo; +import lombok.RequiredArgsConstructor; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import java.util.Arrays; +import java.util.Date; +import java.util.List; /** * 病人管理Controller - * + * * @author ft * @date 2020-11-24 */ @RequiredArgsConstructor(onConstructor_ = @Autowired) @RestController -@RequestMapping("/fantang/patient" ) +@RequestMapping("/fantang/patient") public class FtPatientDaoController extends BaseController { private final IFtPatientDaoService iFtPatientDaoService; @@ -46,50 +39,69 @@ public class FtPatientDaoController extends BaseController { */ @PreAuthorize("@ss.hasPermi('fantang:patient:list')") @GetMapping("/list") - public TableDataInfo list(FtPatientDao ftPatientDao) - { + public TableDataInfo list(FtPatientDao ftPatientDao) { startPage(); LambdaQueryWrapper lqw = Wrappers.lambdaQuery(ftPatientDao); - if (StringUtils.isNotBlank(ftPatientDao.getName())){ - lqw.like(FtPatientDao::getName ,ftPatientDao.getName()); + if (StringUtils.isNotBlank(ftPatientDao.getName())) { + lqw.like(FtPatientDao::getName, ftPatientDao.getName()); } - if (StringUtils.isNotBlank(ftPatientDao.getBedId())){ - lqw.eq(FtPatientDao::getBedId ,ftPatientDao.getBedId()); + if (StringUtils.isNotBlank(ftPatientDao.getBedId())) { + lqw.eq(FtPatientDao::getBedId, ftPatientDao.getBedId()); } - if (StringUtils.isNotBlank(ftPatientDao.getHospitalId())){ - lqw.eq(FtPatientDao::getHospitalId ,ftPatientDao.getHospitalId()); + if (StringUtils.isNotBlank(ftPatientDao.getHospitalId())) { + lqw.eq(FtPatientDao::getHospitalId, ftPatientDao.getHospitalId()); } List list = iFtPatientDaoService.list(lqw); return getDataTable(list); } + /** + * 根据 departId 查询病人列表 + */ + @GetMapping("/selectPatientByDepartId/{departId}") + public AjaxResult selectPatientByDepartId(@PathVariable("departId") Long departId) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("depart_id", departId); + List list = iFtPatientDaoService.list(wrapper); + return AjaxResult.success(list); + } + + /** + * 根据 patientId 查询病人床号 + */ + @GetMapping("/getBedIdById/{patientId}") + public AjaxResult getBedIdById(@PathVariable("patientId") Long patientId) { + String bedId = iFtPatientDaoService.getById(patientId).getBedId(); + return AjaxResult.success(bedId); + } + /** * 导出病人管理列表 */ - @PreAuthorize("@ss.hasPermi('fantang:patient:export')" ) - @Log(title = "病人管理" , businessType = BusinessType.EXPORT) - @GetMapping("/export" ) + @PreAuthorize("@ss.hasPermi('fantang:patient:export')") + @Log(title = "病人管理", businessType = BusinessType.EXPORT) + @GetMapping("/export") public AjaxResult export(FtPatientDao ftPatientDao) { LambdaQueryWrapper lqw = new LambdaQueryWrapper(ftPatientDao); List list = iFtPatientDaoService.list(lqw); - ExcelUtil util = new ExcelUtil(FtPatientDao. class); - return util.exportExcel(list, "patient" ); + ExcelUtil util = new ExcelUtil(FtPatientDao.class); + return util.exportExcel(list, "patient"); } /** * 获取病人管理详细信息 */ - @PreAuthorize("@ss.hasPermi('fantang:patient:query')" ) - @GetMapping(value = "/{patientId}" ) - public AjaxResult getInfo(@PathVariable("patientId" ) Long patientId) { + @PreAuthorize("@ss.hasPermi('fantang:patient:query')") + @GetMapping(value = "/{patientId}") + public AjaxResult getInfo(@PathVariable("patientId") Long patientId) { return AjaxResult.success(iFtPatientDaoService.getById(patientId)); } /** * 新增病人管理 */ - @PreAuthorize("@ss.hasPermi('fantang:patient:add')" ) - @Log(title = "病人管理" , businessType = BusinessType.INSERT) + @PreAuthorize("@ss.hasPermi('fantang:patient:add')") + @Log(title = "病人管理", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody FtPatientDao ftPatientDao) { @@ -101,8 +113,8 @@ public class FtPatientDaoController extends BaseController { /** * 修改病人管理 */ - @PreAuthorize("@ss.hasPermi('fantang:patient:edit')" ) - @Log(title = "病人管理" , businessType = BusinessType.UPDATE) + @PreAuthorize("@ss.hasPermi('fantang:patient:edit')") + @Log(title = "病人管理", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody FtPatientDao ftPatientDao) { return toAjax(iFtPatientDaoService.updateById(ftPatientDao) ? 1 : 0); @@ -111,9 +123,9 @@ public class FtPatientDaoController extends BaseController { /** * 删除病人管理 */ - @PreAuthorize("@ss.hasPermi('fantang:patient:remove')" ) - @Log(title = "病人管理" , businessType = BusinessType.DELETE) - @DeleteMapping("/{patientIds}" ) + @PreAuthorize("@ss.hasPermi('fantang:patient:remove')") + @Log(title = "病人管理", businessType = BusinessType.DELETE) + @DeleteMapping("/{patientIds}") public AjaxResult remove(@PathVariable Long[] patientIds) { return toAjax(iFtPatientDaoService.removeByIds(Arrays.asList(patientIds)) ? 1 : 0); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtCateringDao.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtCateringDao.java new file mode 100644 index 000000000..c0cd04a44 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtCateringDao.java @@ -0,0 +1,82 @@ +package com.ruoyi.system.fantang.domain; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.ToString; +import lombok.experimental.Accessors; +import com.ruoyi.common.annotation.Excel; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import java.io.Serializable; +import java.util.Date; +import java.math.BigDecimal; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 配餐功能对象 ft_catering + * + * @author ft + * @date 2020-12-07 + */ +@Data +@ToString +@EqualsAndHashCode +@NoArgsConstructor +@Accessors(chain = true) +@TableName("ft_catering") +public class FtCateringDao implements Serializable { + +private static final long serialVersionUID=1L; + + + /** id */ + @TableId(value = "id") + private Long id; + + /** 病人 id */ + private Long patientId; + + /** 正餐类型 */ + @Excel(name = "正餐类型") + private Integer type; + + /** 配餐号 */ + @Excel(name = "配餐号") + private Long number; + + /** 配餐频次 */ + @Excel(name = "配餐频次") + private String frequency; + + /** 用法 */ + @Excel(name = "用法") + private Integer usage; + + /** 是否代替正餐 */ + private Integer isReplace; + + /** 作废标志 */ + private Integer flag; + + /** 更新日期 */ + private Date updateAt; + + /** 更新人 */ + @Excel(name = "更新人") + private String updateBy; + + /** 创建时间 */ + @Excel(name = "创建时间" , width = 30, dateFormat = "yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createAt; + + /** 创建人 */ + private String createBy; + + /** 描述 */ + @Excel(name = "描述") + private String describe; +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtCateringDaoMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtCateringDaoMapper.java new file mode 100644 index 000000000..2a2fc9dd7 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtCateringDaoMapper.java @@ -0,0 +1,14 @@ +package com.ruoyi.system.fantang.mapper; + +import com.ruoyi.system.fantang.domain.FtCateringDao; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * 配餐功能Mapper接口 + * + * @author ft + * @date 2020-12-07 + */ +public interface FtCateringDaoMapper extends BaseMapper { + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/IFtCateringDaoService.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/IFtCateringDaoService.java new file mode 100644 index 000000000..864964de7 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/IFtCateringDaoService.java @@ -0,0 +1,14 @@ +package com.ruoyi.system.fantang.service; + +import com.ruoyi.system.fantang.domain.FtCateringDao; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * 配餐功能Service接口 + * + * @author ft + * @date 2020-12-07 + */ +public interface IFtCateringDaoService extends IService { + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/impl/FtCateringDaoServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/impl/FtCateringDaoServiceImpl.java new file mode 100644 index 000000000..99b181da5 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/impl/FtCateringDaoServiceImpl.java @@ -0,0 +1,18 @@ +package com.ruoyi.system.fantang.service.impl; + +import org.springframework.stereotype.Service; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ruoyi.system.fantang.mapper.FtCateringDaoMapper; +import com.ruoyi.system.fantang.domain.FtCateringDao; +import com.ruoyi.system.fantang.service.IFtCateringDaoService; + +/** + * 配餐功能Service业务层处理 + * + * @author ft + * @date 2020-12-07 + */ +@Service +public class FtCateringDaoServiceImpl extends ServiceImpl implements IFtCateringDaoService { + +} diff --git a/ruoyi-system/src/main/resources/mapper/fantang/FtCateringDaoMapper.xml b/ruoyi-system/src/main/resources/mapper/fantang/FtCateringDaoMapper.xml new file mode 100644 index 000000000..a32b815d7 --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/fantang/FtCateringDaoMapper.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ruoyi-ui/src/api/fantang/catering.js b/ruoyi-ui/src/api/fantang/catering.js new file mode 100644 index 000000000..95f685b09 --- /dev/null +++ b/ruoyi-ui/src/api/fantang/catering.js @@ -0,0 +1,53 @@ +import request from '@/utils/request' + +// 查询配餐功能列表 +export function listCatering(query) { + return request({ + url: '/fantang/catering/list', + method: 'get', + params: query + }) +} + +// 查询配餐功能详细 +export function getCatering(id) { + return request({ + url: '/fantang/catering/' + id, + method: 'get' + }) +} + +// 新增配餐功能 +export function addCatering(data) { + return request({ + url: '/fantang/catering', + method: 'post', + data: data + }) +} + +// 修改配餐功能 +export function updateCatering(data) { + return request({ + url: '/fantang/catering', + method: 'put', + data: data + }) +} + +// 删除配餐功能 +export function delCatering(id) { + return request({ + url: '/fantang/catering/' + id, + method: 'delete' + }) +} + +// 导出配餐功能 +export function exportCatering(query) { + return request({ + url: '/fantang/catering/export', + method: 'get', + params: query + }) +} \ No newline at end of file diff --git a/ruoyi-ui/src/api/fantang/patient.js b/ruoyi-ui/src/api/fantang/patient.js index 2bef131f3..3b9db3a33 100644 --- a/ruoyi-ui/src/api/fantang/patient.js +++ b/ruoyi-ui/src/api/fantang/patient.js @@ -9,6 +9,22 @@ export function listPatient(query) { }) } +// 根据 departId 查询病人列表 +export function selectPatientByDepartId(departId) { + return request({ + url: '/fantang/patient/selectPatientByDepartId/' + departId, + method: 'get', + }) +} + +// 根据 patientId 查询病人床号 +export function getBedIdById(patientId) { + return request({ + url: '/fantang/patient/getBedIdById/' + patientId, + method: 'get', + }) +} + // 查询病人管理详细 export function getPatient(patientId) { return request({ @@ -50,4 +66,4 @@ export function exportPatient(query) { method: 'get', params: query }) -} \ No newline at end of file +} diff --git a/ruoyi-ui/src/views/fantang/catering/index.vue b/ruoyi-ui/src/views/fantang/catering/index.vue new file mode 100644 index 000000000..a90446e9e --- /dev/null +++ b/ruoyi-ui/src/views/fantang/catering/index.vue @@ -0,0 +1,554 @@ + + +