护理员代码移植
This commit is contained in:
parent
75f42d3cb9
commit
51655d2a1a
@ -98,6 +98,21 @@ public class SysUser extends BaseEntity {
|
||||
@Excel(name = "最后登录时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", type = Type.EXPORT)
|
||||
private Date loginDate;
|
||||
|
||||
/**
|
||||
* 用户所属护理站id集合,多个用逗号隔开
|
||||
*/
|
||||
private String nurseStationIds;
|
||||
|
||||
/**
|
||||
* 护理站人员表id
|
||||
*/
|
||||
private Long nurseStationPersonId;
|
||||
|
||||
/**
|
||||
* 护理员App账号密码
|
||||
*/
|
||||
private String stationPersonPassword;
|
||||
|
||||
/**
|
||||
* 部门对象
|
||||
*/
|
||||
@ -135,6 +150,30 @@ public class SysUser extends BaseEntity {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public String getNurseStationIds() {
|
||||
return nurseStationIds;
|
||||
}
|
||||
|
||||
public void setNurseStationIds(String nurseStationIds) {
|
||||
this.nurseStationIds = nurseStationIds;
|
||||
}
|
||||
|
||||
public String getStationPersonPassword() {
|
||||
return stationPersonPassword;
|
||||
}
|
||||
|
||||
public void setStationPersonPassword(String stationPersonPassword) {
|
||||
this.stationPersonPassword = stationPersonPassword;
|
||||
}
|
||||
|
||||
public Long getNurseStationPersonId() {
|
||||
return nurseStationPersonId;
|
||||
}
|
||||
|
||||
public void setNurseStationPersonId(Long nurseStationPersonId) {
|
||||
this.nurseStationPersonId = nurseStationPersonId;
|
||||
}
|
||||
|
||||
public Long getUserId() {
|
||||
return userId;
|
||||
}
|
||||
@ -317,6 +356,7 @@ public class SysUser extends BaseEntity {
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.append("dept", getDept())
|
||||
.append("nurseStationIds", getNurseStationIds())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,29 @@
|
||||
package com.xinelu.common.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* @Description 护理站人员信息表状态枚举 CHECKED:已审核,NOT_CHECK:未审核
|
||||
* @Author ljh
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Getter
|
||||
public enum ModifyCheckStatusEnum {
|
||||
|
||||
/**
|
||||
* 已审核
|
||||
*/
|
||||
CHECKED("CHECKED"),
|
||||
|
||||
/**
|
||||
* 未审核
|
||||
*/
|
||||
NOT_CHECK("NOT_CHECK"),
|
||||
;
|
||||
|
||||
final private String info;
|
||||
|
||||
ModifyCheckStatusEnum(String info) {
|
||||
this.info = info;
|
||||
}
|
||||
}
|
||||
@ -34,5 +34,9 @@
|
||||
<artifactId>swagger-models</artifactId>
|
||||
<version>1.6.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.xinelu</groupId>
|
||||
<artifactId>xinelu-system</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
@ -0,0 +1,98 @@
|
||||
package com.xinelu.manage.controller.nursestationclassify;
|
||||
|
||||
import com.xinelu.common.annotation.Log;
|
||||
import com.xinelu.common.core.controller.BaseController;
|
||||
import com.xinelu.common.core.domain.AjaxResult;
|
||||
import com.xinelu.common.core.page.TableDataInfo;
|
||||
import com.xinelu.common.enums.BusinessType;
|
||||
import com.xinelu.common.utils.poi.ExcelUtil;
|
||||
import com.xinelu.manage.domain.nurseclassifyinfo.NurseClassifyInfo;
|
||||
import com.xinelu.manage.dto.nurseclassifyinfo.NurseClassifyInfoDTO;
|
||||
import com.xinelu.manage.service.nurseclassifyinfo.INurseClassifyInfoService;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 护理机构分类信息Controller
|
||||
*
|
||||
* @author ZHANGHENG
|
||||
* @date 2023-02-08
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/stationClassify")
|
||||
public class NurseStationClassifyController extends BaseController {
|
||||
@Resource
|
||||
private INurseClassifyInfoService nurseClassifyInfoService;
|
||||
|
||||
/**
|
||||
* 查询护理机构分类信息列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(NurseClassifyInfo nurseClassifyInfo) {
|
||||
startPage();
|
||||
List<NurseClassifyInfo> list = nurseClassifyInfoService.selectNurseStationClassifyList(nurseClassifyInfo);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出护理机构分类信息列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:stationClassify:export')")
|
||||
@Log(title = "护理机构分类信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, NurseClassifyInfo nurseClassifyInfo) {
|
||||
List<NurseClassifyInfo> list = nurseClassifyInfoService.selectNurseStationClassifyList(nurseClassifyInfo);
|
||||
ExcelUtil<NurseClassifyInfo> util = new ExcelUtil<>(NurseClassifyInfo.class);
|
||||
util.exportExcel(response, list, "护理机构分类信息数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取护理机构分类信息详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:stationClassify:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return AjaxResult.success(nurseClassifyInfoService.selectNurseStationClassifyById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增护理机构分类信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:stationClassify:add')")
|
||||
@Log(title = "护理机构分类信息", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/add")
|
||||
public AjaxResult add(@RequestBody NurseClassifyInfoDTO nurseClassifyInfoList) {
|
||||
if (Objects.isNull(nurseClassifyInfoList)) {
|
||||
return AjaxResult.error("请添加护理机构分类!");
|
||||
}
|
||||
return nurseClassifyInfoService.insertNurseStationClassifyInfo(nurseClassifyInfoList.getNurseClassifyInfoList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改护理机构分类信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:stationClassify:edit')")
|
||||
@Log(title = "护理机构分类信息", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/edit")
|
||||
public AjaxResult edit(@RequestBody NurseClassifyInfo nurseClassifyInfo) {
|
||||
if (Objects.isNull(nurseClassifyInfo) || Objects.isNull(nurseClassifyInfo.getId())) {
|
||||
return AjaxResult.error("护理机构信息不能为空!");
|
||||
}
|
||||
return nurseClassifyInfoService.updateNurseStationClassifyInfo(nurseClassifyInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除护理机构分类信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:stationClassify:remove')")
|
||||
@Log(title = "护理机构分类信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return nurseClassifyInfoService.deleteNurseStationClassifyByIds(ids);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,97 @@
|
||||
package com.xinelu.manage.controller.nursestationdepartment;
|
||||
|
||||
import com.xinelu.common.annotation.Log;
|
||||
import com.xinelu.common.core.controller.BaseController;
|
||||
import com.xinelu.common.core.domain.AjaxResult;
|
||||
import com.xinelu.common.core.page.TableDataInfo;
|
||||
import com.xinelu.common.custominterface.Insert;
|
||||
import com.xinelu.common.enums.BusinessType;
|
||||
import com.xinelu.common.utils.poi.ExcelUtil;
|
||||
import com.xinelu.manage.domain.nursestationdepartment.NurseStationDepartment;
|
||||
import com.xinelu.manage.dto.nursestationdepartment.NurseStationDepartmentDTO;
|
||||
import com.xinelu.manage.service.nursestationdepartment.INurseStationDepartmentService;
|
||||
import com.xinelu.manage.vo.nursestationdepartment.NurseStationDepartmentVO;
|
||||
import net.sf.jsqlparser.statement.update.Update;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 护理站部门信息Controller
|
||||
*
|
||||
* @author zh
|
||||
* @date 2022-09-13
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/StationDepartment")
|
||||
public class StationDepartmentController extends BaseController {
|
||||
|
||||
@Resource
|
||||
private INurseStationDepartmentService nurseStationDepartmentService;
|
||||
|
||||
/**
|
||||
* 查询护理站部门信息列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:StationDepartment:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(NurseStationDepartmentVO nurseStationDepartment) {
|
||||
startPage();
|
||||
List<NurseStationDepartmentVO> list = nurseStationDepartmentService.selectNurseStationDepartmentList(nurseStationDepartment);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出护理站部门信息列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:StationDepartment:export')")
|
||||
@Log(title = "护理站部门信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, NurseStationDepartmentVO nurseStationDepartment) {
|
||||
List<NurseStationDepartmentVO> list = nurseStationDepartmentService.selectNurseStationDepartmentList(nurseStationDepartment);
|
||||
ExcelUtil<NurseStationDepartmentVO> util = new ExcelUtil<>(NurseStationDepartmentVO.class);
|
||||
util.exportExcel(response, list, "护理站部门信息数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取护理站部门信息详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:StationDepartment:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return AjaxResult.success(nurseStationDepartmentService.selectNurseStationDepartmentById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增护理站部门信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:StationDepartment:add')")
|
||||
@Log(title = "护理站部门信息", businessType = BusinessType.INSERT)
|
||||
@PostMapping(value = "/add")
|
||||
public AjaxResult add(@Validated(Insert.class) @RequestBody NurseStationDepartmentDTO nurseStationDepartment) {
|
||||
return nurseStationDepartmentService.insertStationDepartmentList(nurseStationDepartment.getNurseStationDepartmentList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改护理站部门信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:StationDepartment:edit')")
|
||||
@Log(title = "护理站部门信息", businessType = BusinessType.UPDATE)
|
||||
@PostMapping(value = "/edit")
|
||||
public AjaxResult edit(@Validated(Update.class) @RequestBody NurseStationDepartment nurseStationDepartment) {
|
||||
return nurseStationDepartmentService.updateNurseStationDepartment(nurseStationDepartment);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除护理站部门信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:StationDepartment:remove')")
|
||||
@Log(title = "护理站部门信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(nurseStationDepartmentService.deleteNurseStationDepartmentByIds(ids));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,171 @@
|
||||
package com.xinelu.manage.controller.nursestationitem;
|
||||
|
||||
|
||||
import com.xinelu.common.annotation.Log;
|
||||
import com.xinelu.common.constant.Constants;
|
||||
import com.xinelu.common.core.controller.BaseController;
|
||||
import com.xinelu.common.core.domain.AjaxResult;
|
||||
import com.xinelu.common.core.page.TableDataInfo;
|
||||
import com.xinelu.common.custominterface.Insert;
|
||||
import com.xinelu.common.enums.BusinessType;
|
||||
import com.xinelu.common.exception.ServiceException;
|
||||
import com.xinelu.common.utils.poi.ExcelUtil;
|
||||
import com.xinelu.manage.domain.nursestationitem.NurseStationItem;
|
||||
import com.xinelu.manage.dto.nursestationitem.NurseStationItemDTO;
|
||||
import com.xinelu.manage.dto.nursestationitem.NurseStationItemImportDTO;
|
||||
import com.xinelu.manage.service.nursestationitem.INurseStationItemService;
|
||||
import com.xinelu.manage.vo.nursestationitem.NurseStationItemVO;
|
||||
import net.sf.jsqlparser.statement.update.Update;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.util.ResourceUtils;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.ServletOutputStream;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 护理站护理项目Controller
|
||||
*
|
||||
* @author ljh
|
||||
* @date 2022-09-02
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/stationItem")
|
||||
public class NurseStationItemController extends BaseController {
|
||||
@Resource
|
||||
private INurseStationItemService nurseStationItemService;
|
||||
|
||||
/**
|
||||
* 查询护理站护理项目列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:stationItem:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(NurseStationItem nurseStationItem) {
|
||||
List<NurseStationItemVO> list = nurseStationItemService.selectNurseStationItemList(nurseStationItem);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出护理站护理项目列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:stationItem:export')")
|
||||
@Log(title = "护理站护理项目", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, NurseStationItem nurseStationItem) {
|
||||
List<NurseStationItemVO> list = nurseStationItemService.selectNurseStationItemList(nurseStationItem);
|
||||
ExcelUtil<NurseStationItemVO> util = new ExcelUtil<>(NurseStationItemVO.class);
|
||||
util.exportExcel(response, list, "护理站护理项目数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取护理站护理项目详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:stationItem:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return AjaxResult.success(nurseStationItemService.selectNurseStationItemById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增护理站护理项目
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:stationItem:add')")
|
||||
@Log(title = "护理站护理项目", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/add")
|
||||
public AjaxResult add(@Validated(Insert.class) @RequestBody NurseStationItemDTO nurseStationItemDTO) {
|
||||
return nurseStationItemService.insertNurseStationItem(nurseStationItemDTO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改护理站护理项目
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:stationItem:edit')")
|
||||
@Log(title = "护理站护理项目", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/edit")
|
||||
public AjaxResult edit(@Validated(Update.class) @RequestBody NurseStationItemDTO nurseStationItemDTO) {
|
||||
return nurseStationItemService.updateNurseStationItem(nurseStationItemDTO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除护理站护理项目
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:stationItem:remove')")
|
||||
@Log(title = "护理站护理项目", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return nurseStationItemService.deleteNurseStationItemByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 护理项目上下架
|
||||
*/
|
||||
@PostMapping("/updateShelfStatus")
|
||||
public AjaxResult updateShelfStatus(Long id, String shelfStatus) {
|
||||
if (Objects.isNull(id)) {
|
||||
return AjaxResult.error("护理项目为空!");
|
||||
}
|
||||
if (StringUtils.isBlank(shelfStatus)) {
|
||||
return AjaxResult.error("上架状态为空!");
|
||||
}
|
||||
return nurseStationItemService.updateShelfStatus(id, shelfStatus);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入护理站项目
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:stationItem:importStationItem')")
|
||||
@Log(title = "导入护理站项目信息", businessType = BusinessType.IMPORT)
|
||||
@PostMapping("/importData")
|
||||
public AjaxResult importData(MultipartFile file) throws Exception {
|
||||
//判断excel里面是否有数据/文件格式
|
||||
if (Objects.isNull(file) || StringUtils.isBlank(file.getOriginalFilename())) {
|
||||
return AjaxResult.error("请选择所需要导入的文件!");
|
||||
}
|
||||
//获取文件名
|
||||
String fileName = file.getOriginalFilename();
|
||||
if (!fileName.endsWith(Constants.XLSX) && !fileName.endsWith(Constants.XLS)) {
|
||||
return AjaxResult.error("导入文件格式不正确,请导入xlsx或xls格式的文件!");
|
||||
}
|
||||
ExcelUtil<NurseStationItemImportDTO> util = new ExcelUtil<>(NurseStationItemImportDTO.class);
|
||||
List<NurseStationItemImportDTO> list = util.importExcel(file.getInputStream());
|
||||
return nurseStationItemService.importData(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 下载导入模板
|
||||
*/
|
||||
@Log(title = "下载导入模板", businessType = BusinessType.IMPORT)
|
||||
@PostMapping("/downloadTemplate")
|
||||
public void download(@RequestParam(value = "fileType") String fileType, HttpServletResponse res) throws IOException {
|
||||
if (StringUtils.isBlank(fileType)) {
|
||||
throw new ServiceException("请选择文件类型!");
|
||||
}
|
||||
File file = null;
|
||||
if (fileType.equals(Constants.NURSE_STATION_ITEM_TEMPLATE)) {
|
||||
file = ResourceUtils.getFile("classpath:template/护理站项目基本信息导入模板.xlsx");
|
||||
}
|
||||
if (fileType.equals(Constants.NURSE_STATION_CONSUMABLE)) {
|
||||
file = ResourceUtils.getFile("classpath:template/护理耗材基本信息导入模板.xlsx");
|
||||
}
|
||||
if (Objects.isNull(file)) {
|
||||
throw new ServiceException("下载导入模板文件失败,请联系管理员!");
|
||||
}
|
||||
res.setCharacterEncoding("UTF-8");
|
||||
res.setHeader("Content-Disposition", "inline;filename=" + fileType + ".txt");
|
||||
res.setContentType("text/plain;UTF-8");
|
||||
ServletOutputStream os = res.getOutputStream();
|
||||
byte[] bytes = FileUtils.readFileToByteArray(file);
|
||||
os.write(bytes);
|
||||
os.flush();
|
||||
os.close();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,146 @@
|
||||
package com.xinelu.manage.controller.nursestationperson;
|
||||
|
||||
import com.xinelu.common.annotation.Log;
|
||||
import com.xinelu.common.constant.Constants;
|
||||
import com.xinelu.common.core.controller.BaseController;
|
||||
import com.xinelu.common.core.domain.AjaxResult;
|
||||
import com.xinelu.common.core.page.TableDataInfo;
|
||||
import com.xinelu.common.custominterface.Insert;
|
||||
import com.xinelu.common.custominterface.Update;
|
||||
import com.xinelu.common.enums.BusinessType;
|
||||
import com.xinelu.common.utils.poi.ExcelUtil;
|
||||
import com.xinelu.manage.domain.nursestationperson.NurseStationPerson;
|
||||
import com.xinelu.manage.dto.nursestationperson.NurseStationPersonCheckDTO;
|
||||
import com.xinelu.manage.dto.nursestationperson.NurseStationPersonDTO;
|
||||
import com.xinelu.manage.dto.nursestationperson.NurseStationPersonImportDTO;
|
||||
import com.xinelu.manage.service.nursestationperson.INurseStationPersonService;
|
||||
import com.xinelu.manage.vo.nursestationperson.NurseStationPersonVO;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 护理站人员信息Controller
|
||||
*
|
||||
* @author ljh
|
||||
* @date 2022-09-02
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/person")
|
||||
public class NurseStationPersonController extends BaseController {
|
||||
@Resource
|
||||
private INurseStationPersonService nurseStationPersonService;
|
||||
|
||||
/**
|
||||
* 查询护理站人员信息列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(NurseStationPerson nurseStationPerson) {
|
||||
startPage();
|
||||
List<NurseStationPerson> list = nurseStationPersonService.selectNurseStationPersonList(nurseStationPerson);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出护理站人员信息列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:person:export')")
|
||||
@Log(title = "护理站人员信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, NurseStationPerson nurseStationPerson) {
|
||||
List<NurseStationPerson> list = nurseStationPersonService.selectNurseStationPersonList(nurseStationPerson);
|
||||
ExcelUtil<NurseStationPerson> util = new ExcelUtil<>(NurseStationPerson.class);
|
||||
util.exportExcel(response, list, "护理站人员信息数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取护理站人员信息详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:person:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return AjaxResult.success(nurseStationPersonService.selectNurseStationPersonById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增护理站人员信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:person:add')")
|
||||
@Log(title = "护理站人员信息", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/add")
|
||||
public AjaxResult add(@Validated(Insert.class) @RequestBody NurseStationPersonDTO nurseStationPerson) {
|
||||
return nurseStationPersonService.insertNurseStationPersonList(nurseStationPerson);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改护理站人员信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:person:edit')")
|
||||
@Log(title = "护理站人员信息", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/edit")
|
||||
public AjaxResult edit(@Validated(Update.class) @RequestBody NurseStationPersonDTO nurseStationPerson) {
|
||||
return nurseStationPersonService.updateNurseStationPerson(nurseStationPerson);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除护理站人员信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:person:remove')")
|
||||
@Log(title = "护理站人员信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return nurseStationPersonService.deleteNurseStationPersonByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询护理站人员信息列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:person:list')")
|
||||
@GetMapping("/getNurseStationPersonList")
|
||||
public TableDataInfo getNurseStationPersonList(NurseStationPersonVO nurseStationPerson) {
|
||||
startPage();
|
||||
List<NurseStationPersonVO> nurseStationPersonList = nurseStationPersonService.getNurseStationPersonList(nurseStationPerson);
|
||||
return getDataTable(nurseStationPersonList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入护理站人员信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:person:importStationPerson')")
|
||||
@PostMapping("/insertNurseStationPersonImportList")
|
||||
public AjaxResult insertNurseStationPersonImportList(MultipartFile file) throws Exception {
|
||||
//判断文件是否为空
|
||||
if (Objects.isNull(file) || StringUtils.isBlank(file.getOriginalFilename())) {
|
||||
return AjaxResult.error("请选择所要导入的护理站人员信息!");
|
||||
}
|
||||
if (!file.getOriginalFilename().endsWith(Constants.XLSX) && !file.getOriginalFilename().endsWith(Constants.XLS)) {
|
||||
return AjaxResult.error("文件格式不正确,请选择xlsx或者xls格式的文件!");
|
||||
}
|
||||
ExcelUtil<NurseStationPersonImportDTO> util = new ExcelUtil<>(NurseStationPersonImportDTO.class);
|
||||
List<NurseStationPersonImportDTO> list = util.importExcel(file.getInputStream());
|
||||
return nurseStationPersonService.insertNurseStationPersonImportList(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 审核接口根据id查询护理站人员信息以及未审核的证书
|
||||
*/
|
||||
@GetMapping(value = "/getNurseStationPersonCheck/{id}")
|
||||
public AjaxResult getNurseStationPersonCheck(@PathVariable("id") Long id) {
|
||||
return AjaxResult.success(nurseStationPersonService.getNurseStationPersonCheck(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 管理端更新护理人员主表信息与证书信息
|
||||
*/
|
||||
@PostMapping("/updateNurseStationPersonChecks")
|
||||
public AjaxResult updateNurseStationPersonChecks(@RequestBody NurseStationPersonCheckDTO nurseStationPersonCheckDTO) throws Exception {
|
||||
return nurseStationPersonService.updateNurseStationPersonChecks(nurseStationPersonCheckDTO);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,98 @@
|
||||
package com.xinelu.manage.domain.nursestationdepartment;
|
||||
|
||||
import com.xinelu.common.annotation.Excel;
|
||||
import com.xinelu.common.core.domain.BaseDomain;
|
||||
import com.xinelu.common.custominterface.Insert;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import net.sf.jsqlparser.statement.update.Update;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* 护理站部门信息对象 nurse_station_department
|
||||
*
|
||||
* @author xinyilu
|
||||
* @date 2022-09-13
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel(value = "护理站部门信息对象", description = "nurse_station_department")
|
||||
public class NurseStationDepartment extends BaseDomain {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@NotNull(message = "护理站科室id不能为空", groups = {Update.class})
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 护理站表id
|
||||
*/
|
||||
@ApiModelProperty(value = "护理站表id")
|
||||
@Excel(name = "护理站表id")
|
||||
@NotNull(message = "护理站表id不能为空", groups = {Insert.class, Update.class})
|
||||
private Long nurseStationId;
|
||||
|
||||
/**
|
||||
* 科室编码
|
||||
*/
|
||||
@ApiModelProperty(value = "科室编码")
|
||||
@Excel(name = "科室编码")
|
||||
private String departmentCode;
|
||||
|
||||
/**
|
||||
* 科室名称
|
||||
*/
|
||||
@NotBlank(message = "科室名称不能为空", groups = {Insert.class, Update.class})
|
||||
@ApiModelProperty(value = "科室名称")
|
||||
@Excel(name = "科室名称")
|
||||
@Length(max = 20, message = "科室名称不能超过20位", groups = {Insert.class, Update.class})
|
||||
private String departmentName;
|
||||
|
||||
/**
|
||||
* 科室负责人名称
|
||||
*/
|
||||
@NotBlank(message = "科室负责人名称不能为空", groups = {Insert.class, Update.class})
|
||||
@ApiModelProperty(value = "科室负责人名称")
|
||||
@Excel(name = "科室负责人名称")
|
||||
@Length(max = 20, message = "科室负责人名称不能超过20位", groups = {Insert.class, Update.class})
|
||||
private String departmentPerson;
|
||||
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
@NotBlank(message = "联系电话不能为空", groups = {Insert.class})
|
||||
@Length(max = 11, message = "手机号码不能超过11位", groups = {Insert.class, Update.class})
|
||||
@ApiModelProperty(value = "联系电话")
|
||||
@Excel(name = "联系电话")
|
||||
private String phone;
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("nurseStationId", getNurseStationId())
|
||||
.append("departmentCode", getDepartmentCode())
|
||||
.append("departmentName", getDepartmentName())
|
||||
.append("departmentPerson", getDepartmentPerson())
|
||||
.append("phone", getPhone())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,227 @@
|
||||
package com.xinelu.manage.domain.nursestationperson;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.xinelu.common.annotation.Excel;
|
||||
import com.xinelu.common.core.domain.BaseDomain;
|
||||
import com.xinelu.common.custominterface.Insert;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import net.sf.jsqlparser.statement.update.Update;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* 护理站人员信息对象 nurse_station_person
|
||||
*
|
||||
* @author ljh
|
||||
* @date 2022-09-02
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel(value = "护理站人员信息对象", description = "nurse_station_person")
|
||||
public class NurseStationPerson extends BaseDomain implements Serializable {
|
||||
private static final long serialVersionUID = -1396000999445946255L;
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@NotNull(message = "id不能为空!", groups = {Update.class})
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 护理站表id
|
||||
*/
|
||||
@ApiModelProperty(value = "护理站表id")
|
||||
@Excel(name = "护理站表id")
|
||||
@NotNull(message = "护理站表id不能为空", groups = {Insert.class, Update.class})
|
||||
private Long nurseStationId;
|
||||
|
||||
/**
|
||||
* 所属科室编码
|
||||
*/
|
||||
@ApiModelProperty(value = "所属科室编码")
|
||||
@Excel(name = "所属科室编码")
|
||||
@NotBlank(message = "所属科室编码不能为空", groups = {Insert.class, Update.class})
|
||||
private String departmentCode;
|
||||
|
||||
/**
|
||||
* 创建人id
|
||||
*/
|
||||
@ApiModelProperty(value = "创建人id")
|
||||
@Excel(name = "创建人id")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 护理站人员编码
|
||||
*/
|
||||
@ApiModelProperty(value = "护理站人员编码")
|
||||
@Excel(name = "护理站人员编码")
|
||||
private String nursePersonCode;
|
||||
|
||||
/**
|
||||
* 护理站人员名称
|
||||
*/
|
||||
@ApiModelProperty(value = "护理站人员名称")
|
||||
@Excel(name = "护理站人员名称")
|
||||
@NotBlank(message = "护理站人员名称不能为空", groups = {Insert.class, Update.class})
|
||||
private String nursePersonName;
|
||||
|
||||
/**
|
||||
* 护理站人员类型,NURSE:护士,NURSE_TEACHER:护理师
|
||||
*/
|
||||
@ApiModelProperty(value = "护理站人员类型,NURSE:护士,NURSE_TEACHER:护理师")
|
||||
@Excel(name = "护理站人员类型,NURSE:护士,NURSE_TEACHER:护理师")
|
||||
@NotBlank(message = "护理站人员类型不能为空", groups = {Insert.class, Update.class})
|
||||
private String nursePersonType;
|
||||
|
||||
/**
|
||||
* 性别
|
||||
*/
|
||||
@ApiModelProperty(value = "性别")
|
||||
@Excel(name = "性别")
|
||||
@NotBlank(message = "性别不能为空", groups = {Insert.class, Update.class})
|
||||
private String sex;
|
||||
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
@ApiModelProperty(value = "联系电话")
|
||||
@Excel(name = "联系电话")
|
||||
@NotBlank(message = "联系电话不能为空", groups = {Insert.class, Update.class})
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 居住地址
|
||||
*/
|
||||
@ApiModelProperty(value = "居住地址")
|
||||
@Excel(name = "居住地址")
|
||||
@NotBlank(message = "居住地址不能为空", groups = {Insert.class, Update.class})
|
||||
private String address;
|
||||
/**
|
||||
* 出生日期,yyyy-MM-dd格式
|
||||
*/
|
||||
@ApiModelProperty(value = "出生日期,yyyy-MM-dd格式")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "出生日期,yyyy-MM-dd格式", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private LocalDate birthDate;
|
||||
|
||||
/**
|
||||
* 微信openid
|
||||
*/
|
||||
@ApiModelProperty(value = "微信openid")
|
||||
@Excel(name = "微信openid")
|
||||
private String openid;
|
||||
|
||||
/**
|
||||
* 微信unionid
|
||||
*/
|
||||
@ApiModelProperty(value = "微信unionid")
|
||||
@Excel(name = "微信unionid")
|
||||
private String unionid;
|
||||
|
||||
/**
|
||||
* 星级评级数量,取值为预约订单评价行级数量的平均值
|
||||
*/
|
||||
@ApiModelProperty(value = "星级评级数量,取值为预约订单评价行级数量的平均值")
|
||||
@Excel(name = "星级评级数量,取值为预约订单评价行级数量的平均值")
|
||||
private Integer evaluateStarCount;
|
||||
|
||||
/**
|
||||
* PRIMARY_LEVEL:初级,中级:MIDDLE_LEVEL,高级:HIGH_LEVEL
|
||||
*/
|
||||
@ApiModelProperty(value = "PRIMARY_LEVEL:初级,中级:MIDDLE_LEVEL,高级:HIGH_LEVEL")
|
||||
@Excel(name = "PRIMARY_LEVEL:初级,中级:MIDDLE_LEVEL,高级:HIGH_LEVEL")
|
||||
private String positionalTitleLevel;
|
||||
|
||||
/**
|
||||
* 擅长项目,文本内容
|
||||
*/
|
||||
@ApiModelProperty(value = "擅长项目,文本内容")
|
||||
@Excel(name = "擅长项目,文本内容")
|
||||
@Length(max = 300, message = "擅长项目不能超过300个字符")
|
||||
private String geniusItem;
|
||||
|
||||
/**
|
||||
* 订单佣金收益总金额
|
||||
*/
|
||||
@ApiModelProperty(value = "订单佣金收益总金额")
|
||||
@Excel(name = "订单佣金收益总金额")
|
||||
private BigDecimal totalRevenueAmount;
|
||||
|
||||
/**
|
||||
* 工作状态,ONLINE:在线,BE_BUSY:忙碌,OFFLINE:离线
|
||||
*/
|
||||
@ApiModelProperty(value = "工作状态,ONLINE:在线,BE_BUSY:忙碌,OFFLINE:离线")
|
||||
@Excel(name = "工作状态,ONLINE:在线,BE_BUSY:忙碌,OFFLINE:离线")
|
||||
private String workStatus;
|
||||
|
||||
/**
|
||||
* 修改信息审核状态,CHECKED:已审核,NOT_CHECK
|
||||
*/
|
||||
@ApiModelProperty(value = "修改信息审核状态,CHECKED:已审核,NOT_CHECK")
|
||||
@Excel(name = "修改信息审核状态,CHECKED:已审核,NOT_CHECK")
|
||||
private String modifyCheckStatus;
|
||||
|
||||
/**
|
||||
* 职称级别,存储修改以后待审核的职称级别信息,PRIMARY_LEVEL:初级,中级:MIDDLE_LEVEL,高级:HIGH_LEVEL
|
||||
*/
|
||||
@ApiModelProperty(value = "职称级别,存储修改以后待审核的职称级别信息,PRIMARY_LEVEL:初级,中级:MIDDLE_LEVEL,高级:HIGH_LEVEL")
|
||||
@Excel(name = "职称级别,存储修改以后待审核的职称级别信息,PRIMARY_LEVEL:初级,中级:MIDDLE_LEVEL,高级:HIGH_LEVEL")
|
||||
private String positionalTitleLevelCheck;
|
||||
|
||||
/**
|
||||
* 擅长项目,存储修改以后待审核的擅长项目信息,文本内容
|
||||
*/
|
||||
@ApiModelProperty(value = "擅长项目,存储修改以后待审核的擅长项目信息,文本内容")
|
||||
@Excel(name = "擅长项目,存储修改以后待审核的擅长项目信息,文本内容")
|
||||
private String geniusItemCheck;
|
||||
|
||||
/**
|
||||
* 个人信息修改标识(用于标记用户是否在移动端修改了个人信息),0:否,1:是
|
||||
*/
|
||||
private Integer modifyInfoFlag;
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("nurseStationId", getNurseStationId())
|
||||
.append("departmentCode", getDepartmentCode())
|
||||
.append("userId", getUserId())
|
||||
.append("nursePersonCode", getNursePersonCode())
|
||||
.append("nursePersonName", getNursePersonName())
|
||||
.append("nursePersonType", getNursePersonType())
|
||||
.append("sex", getSex())
|
||||
.append("phone", getPhone())
|
||||
.append("address", getAddress())
|
||||
.append("birthDate", getBirthDate())
|
||||
.append("openid", getOpenid())
|
||||
.append("unionid", getUnionid())
|
||||
.append("evaluateStarCount", getEvaluateStarCount())
|
||||
.append("positionalTitleLevel", getPositionalTitleLevel())
|
||||
.append("geniusItem", getGeniusItem())
|
||||
.append("totalRevenueAmount", getTotalRevenueAmount())
|
||||
.append("workStatus", getWorkStatus())
|
||||
.append("modifyCheckStatus", getModifyCheckStatus())
|
||||
.append("positionalTitleLevelCheck", getPositionalTitleLevelCheck())
|
||||
.append("geniusItemCheck", getGeniusItemCheck())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,101 @@
|
||||
package com.xinelu.manage.domain.nursestationpersoncertificate;
|
||||
|
||||
import com.xinelu.common.annotation.Excel;
|
||||
import com.xinelu.common.core.domain.BaseDomain;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import javax.validation.constraints.Size;
|
||||
import java.io.Serializable;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 护理员证书资质信息对象 nurse_station_person_certificate
|
||||
*
|
||||
* @author xinyilu
|
||||
* @date 2023-03-29
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@ApiModel(value = "护理员证书资质信息对象", description = "nurse_station_person_certificate")
|
||||
public class NurseStationPersonCertificate extends BaseDomain implements Serializable {
|
||||
private static final long serialVersionUID = -2833200235609433932L;
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 护理员表id
|
||||
*/
|
||||
@ApiModelProperty(value = "护理员表id")
|
||||
@Excel(name = "护理员表id")
|
||||
private Long nurseStationPersonId;
|
||||
|
||||
/**
|
||||
* 证书名称
|
||||
*/
|
||||
@ApiModelProperty(value = "证书名称")
|
||||
@Excel(name = "证书名称")
|
||||
@Length(max = 100, message = "证书名称不能超过100个字符")
|
||||
private String certificateName;
|
||||
|
||||
/**
|
||||
* 证书编号
|
||||
*/
|
||||
@ApiModelProperty(value = "证书编号")
|
||||
@Excel(name = "证书编号")
|
||||
private String certificateCode;
|
||||
|
||||
/**
|
||||
* 证书存放路径
|
||||
*/
|
||||
@ApiModelProperty(value = "证书存放路径")
|
||||
@Excel(name = "证书存放路径")
|
||||
private String certificateUrl;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
@Size(min = 0, max = 5, message = "排序不能超过5个字符")
|
||||
private Integer sort;
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
NurseStationPersonCertificate that = (NurseStationPersonCertificate) o;
|
||||
return Objects.equals(nurseStationPersonId, that.nurseStationPersonId) && Objects.equals(certificateUrl, that.certificateUrl);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(nurseStationPersonId, certificateUrl);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("nurseStationPersonId", getNurseStationPersonId())
|
||||
.append("certificateName", getCertificateName())
|
||||
.append("certificateCode", getCertificateCode())
|
||||
.append("certificateUrl", getCertificateUrl())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,85 @@
|
||||
package com.xinelu.manage.domain.nursestationpersoncheck;
|
||||
|
||||
import com.xinelu.common.annotation.Excel;
|
||||
import com.xinelu.common.core.domain.BaseDomain;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import javax.validation.constraints.Size;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 护理人员信息修改审核信息(存放移动端护理员修改信息,PC端审核使用)对象 nurse_station_person_check
|
||||
*
|
||||
* @author xinyilu
|
||||
* @date 2023-03-29
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel(value = "护理人员信息修改审核信息(存放移动端护理员修改信息,PC端审核使用)对象", description = "nurse_station_person_check")
|
||||
public class NurseStationPersonCheck extends BaseDomain implements Serializable {
|
||||
private static final long serialVersionUID = 4672458806845282098L;
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 护理人员表id
|
||||
*/
|
||||
@ApiModelProperty(value = "护理人员表id")
|
||||
@Excel(name = "护理人员表id")
|
||||
private Long nurseStationPersonId;
|
||||
|
||||
/**
|
||||
* 证书名称
|
||||
*/
|
||||
@ApiModelProperty(value = "证书名称")
|
||||
@Excel(name = "证书名称")
|
||||
@Length(max = 100, message = "证书名称不能超过100个字符")
|
||||
private String certificateName;
|
||||
|
||||
/**
|
||||
* 证书编号
|
||||
*/
|
||||
@ApiModelProperty(value = "证书编号")
|
||||
@Excel(name = "证书编号")
|
||||
private String certificateCode;
|
||||
|
||||
/**
|
||||
* 证书存放路径
|
||||
*/
|
||||
@ApiModelProperty(value = "证书存放路径")
|
||||
@Excel(name = "证书存放路径")
|
||||
private String certificateUrl;
|
||||
|
||||
/**
|
||||
* 显示顺序
|
||||
*/
|
||||
@Size(min = 0, max = 5, message = "排序不能超过5个字符")
|
||||
private Integer sort;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("nurseStationPersonId", getNurseStationPersonId())
|
||||
.append("certificateName", getCertificateName())
|
||||
.append("certificateCode", getCertificateCode())
|
||||
.append("certificateUrl", getCertificateUrl())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,23 @@
|
||||
package com.xinelu.manage.dto.nursestationdepartment;
|
||||
|
||||
import com.xinelu.manage.domain.nursestationdepartment.NurseStationDepartment;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description 护理部门输入参数实体类
|
||||
* @Author ZH
|
||||
* @Date 2022-09-09
|
||||
*/
|
||||
@Data
|
||||
public class NurseStationDepartmentDTO implements Serializable {
|
||||
private static final long serialVersionUID = -8735222606935922762L;
|
||||
/**
|
||||
* 护理站部门信息集合
|
||||
*/
|
||||
@Valid
|
||||
private List<NurseStationDepartment> nurseStationDepartmentList;
|
||||
}
|
||||
@ -0,0 +1,57 @@
|
||||
package com.xinelu.manage.dto.nursestationperson;
|
||||
|
||||
|
||||
import com.xinelu.manage.domain.nursestationperson.NurseStationPerson;
|
||||
import com.xinelu.manage.domain.nursestationpersoncheck.NurseStationPersonCheck;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author ljh
|
||||
* @version 1.0
|
||||
* Create by 2023/3/31 9:54
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class NurseStationPersonCheckDTO extends NurseStationPerson implements Serializable {
|
||||
private static final long serialVersionUID = -9114552246239996983L;
|
||||
/**
|
||||
* 护理人员信息修改审核信息(存放移动端护理员修改信息,PC端审核使用)对象
|
||||
**/
|
||||
@Valid
|
||||
private List<NurseStationPersonCheck> nurseStationPersonCheckList;
|
||||
|
||||
/**
|
||||
* 护理站名称
|
||||
**/
|
||||
private String nurseStationName;
|
||||
|
||||
/**
|
||||
* 护理站科室名称
|
||||
**/
|
||||
private String departmentName;
|
||||
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 会员头像地址
|
||||
*/
|
||||
private String avatar;
|
||||
|
||||
/**
|
||||
* user表Id
|
||||
*/
|
||||
private Long userId;
|
||||
}
|
||||
@ -0,0 +1,27 @@
|
||||
package com.xinelu.manage.dto.nursestationperson;
|
||||
|
||||
import com.xinelu.manage.domain.nursestationperson.NurseStationPerson;
|
||||
import com.xinelu.manage.domain.nursestationpersoncertificate.NurseStationPersonCertificate;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author ljh
|
||||
* @version 1.0
|
||||
* Create by 2022/9/13 15:31
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class NurseStationPersonDTO extends NurseStationPerson implements Serializable {
|
||||
private static final long serialVersionUID = -1566015368663268183L;
|
||||
|
||||
/**
|
||||
* 护理员证书资质信息表集合
|
||||
**/
|
||||
@Valid
|
||||
private List<NurseStationPersonCertificate> nurseStationPersonCertificateList;
|
||||
}
|
||||
@ -0,0 +1,91 @@
|
||||
package com.xinelu.manage.dto.nursestationperson;
|
||||
|
||||
|
||||
import com.xinelu.common.annotation.Excel;
|
||||
import com.xinelu.common.core.domain.BaseDomain;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author ljh
|
||||
* @version 1.0
|
||||
* Create by 2022/9/16 12:52
|
||||
*/
|
||||
@Data
|
||||
public class NurseStationPersonImportDTO extends BaseDomain implements Serializable {
|
||||
private static final long serialVersionUID = -679491873860039664L;
|
||||
|
||||
/**
|
||||
* 护理站人员名称
|
||||
*/
|
||||
@Excel(name = "人员姓名")
|
||||
private String nursePersonName;
|
||||
|
||||
/**
|
||||
* 性别
|
||||
*/
|
||||
@Excel(name = "性别")
|
||||
private String sex;
|
||||
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
@Excel(name = "电话")
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 居住地址
|
||||
*/
|
||||
@Excel(name = "住址")
|
||||
private String address;
|
||||
|
||||
/**
|
||||
* 护理站名称
|
||||
*/
|
||||
@Excel(name = "所属护理站")
|
||||
private String nurseStationName;
|
||||
|
||||
/**
|
||||
* 护理站人员类型
|
||||
*/
|
||||
private String nursePersonType;
|
||||
|
||||
/**
|
||||
* 护理站ID
|
||||
*/
|
||||
private Long nurseStationId;
|
||||
|
||||
/**
|
||||
* 科室编码
|
||||
*/
|
||||
private String departmentCode;
|
||||
|
||||
/**
|
||||
* 创建人Id
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 护理站人员编码
|
||||
*/
|
||||
private String nursePersonCode;
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
NurseStationPersonImportDTO that = (NurseStationPersonImportDTO) o;
|
||||
return Objects.equals(phone, that.phone);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(phone);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,82 @@
|
||||
package com.xinelu.manage.mapper.nursestationdepartment;
|
||||
|
||||
|
||||
import com.xinelu.manage.domain.nursestationdepartment.NurseStationDepartment;
|
||||
import com.xinelu.manage.vo.nursestationdepartment.NurseStationDepartmentVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 护理站部门信息Mapper接口
|
||||
*
|
||||
* @author xinyilu
|
||||
* @date 2022-09-13
|
||||
*/
|
||||
public interface NurseStationDepartmentMapper {
|
||||
/**
|
||||
* 查询护理站部门信息
|
||||
*
|
||||
* @param id 护理站部门信息主键
|
||||
* @return 护理站部门信息
|
||||
*/
|
||||
NurseStationDepartmentVO selectNurseStationDepartmentById(Long id);
|
||||
|
||||
/**
|
||||
* 查询护理站部门信息列表
|
||||
*
|
||||
* @param nurseStationDepartment 护理站部门信息
|
||||
* @return 护理站部门信息集合
|
||||
*/
|
||||
List<NurseStationDepartmentVO> selectNurseStationDepartmentList(NurseStationDepartmentVO nurseStationDepartment);
|
||||
|
||||
/**
|
||||
* 新增护理站部门信息
|
||||
*
|
||||
* @param nurseStationDepartment 护理站部门信息
|
||||
* @return 结果
|
||||
*/
|
||||
int insertNurseStationDepartmentList(List<NurseStationDepartment> nurseStationDepartment);
|
||||
|
||||
/**
|
||||
* 修改护理站部门信息
|
||||
*
|
||||
* @param nurseStationDepartment 护理站部门信息
|
||||
* @return 结果
|
||||
*/
|
||||
int updateNurseStationDepartment(NurseStationDepartment nurseStationDepartment);
|
||||
|
||||
/**
|
||||
* 删除护理站部门信息
|
||||
*
|
||||
* @param id 护理站部门信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteNurseStationDepartmentById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除护理站部门信息
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteNurseStationDepartmentByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 根据名称是否有重复的
|
||||
*
|
||||
* @param nurseStationId 科室id
|
||||
* @param departmentName 科室名称
|
||||
* @return int 结果
|
||||
**/
|
||||
int getDepartmentName(@Param("nurseStationId") Long nurseStationId, @Param("departmentName") String departmentName);
|
||||
|
||||
/**
|
||||
* 根据电话是否有重复的
|
||||
*
|
||||
* @param phone 科室电话
|
||||
* @return int 结果
|
||||
**/
|
||||
int getDepartmentPhone(String phone);
|
||||
}
|
||||
@ -0,0 +1,267 @@
|
||||
package com.xinelu.manage.mapper.nursestationperson;
|
||||
|
||||
|
||||
import com.xinelu.common.core.domain.entity.SysUser;
|
||||
import com.xinelu.manage.domain.nursestationperson.NurseStationPerson;
|
||||
import com.xinelu.manage.dto.nursestationperson.NurseStationPersonCheckDTO;
|
||||
import com.xinelu.manage.dto.nursestationperson.NurseStationPersonImportDTO;
|
||||
import com.xinelu.manage.vo.nursestationperson.NurseStationPersonSysUserVO;
|
||||
import com.xinelu.manage.vo.nursestationperson.NurseStationPersonVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 护理站人员信息Mapper接口
|
||||
*
|
||||
* @author ljh
|
||||
* @date 2022-09-02
|
||||
*/
|
||||
public interface NurseStationPersonMapper {
|
||||
/**
|
||||
* 查询护理站人员信息
|
||||
*
|
||||
* @param id 护理站人员信息主键
|
||||
* @return 护理站人员信息
|
||||
*/
|
||||
NurseStationPersonVO selectNurseStationPersonById(Long id);
|
||||
|
||||
/**
|
||||
* 查询护理站人员信息列表
|
||||
*
|
||||
* @param nurseStationPerson 护理站人员信息
|
||||
* @return 护理站人员信息集合
|
||||
*/
|
||||
List<NurseStationPerson> selectNurseStationPersonList(NurseStationPerson nurseStationPerson);
|
||||
|
||||
/**
|
||||
* 新增护理站人员信息
|
||||
*
|
||||
* @param nurseStationPerson 护理站人员信息
|
||||
* @return 结果
|
||||
*/
|
||||
int insertNurseStationPerson(NurseStationPerson nurseStationPerson);
|
||||
|
||||
/**
|
||||
* 修改护理站人员信息
|
||||
*
|
||||
* @param nurseStationPerson 护理站人员信息
|
||||
* @return 结果
|
||||
*/
|
||||
int updateNurseStationPerson(NurseStationPerson nurseStationPerson);
|
||||
|
||||
/**
|
||||
* 删除护理站人员信息
|
||||
*
|
||||
* @param id 护理站人员信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteNurseStationPersonById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除护理站人员信息
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteNurseStationPersonByIds(Long[] ids);
|
||||
|
||||
|
||||
/**
|
||||
* 批量新增护理站人员信息
|
||||
*
|
||||
* @param nurseStationPerson 护理站人员信息
|
||||
* @return int
|
||||
**/
|
||||
int insertNurseStationPersonList(List<NurseStationPerson> nurseStationPerson);
|
||||
|
||||
/**
|
||||
* 查询护理站人员信息以及护理站名称集合
|
||||
*
|
||||
* @param nurseStationPerson 护理站人员信息集合
|
||||
* @return java.util.List<com.xinyilu.base.vo.nursestationperson.NurseStationPersonVO>
|
||||
**/
|
||||
List<NurseStationPersonVO> getNurseStationPersonList(NurseStationPersonVO nurseStationPerson);
|
||||
|
||||
|
||||
/**
|
||||
* 护理站人员导入
|
||||
*
|
||||
* @param nurseStationPerson 护理站人员信息
|
||||
* @return int
|
||||
**/
|
||||
int insertNurseStationPersonImportList(List<NurseStationPerson> nurseStationPerson);
|
||||
|
||||
/**
|
||||
* 根据手机号查重
|
||||
*
|
||||
* @param phone 手机号
|
||||
* @return int
|
||||
**/
|
||||
int getNurseStationPersonPhone(String phone);
|
||||
|
||||
/**
|
||||
* 根据人员名称查询数据库原有人员信息
|
||||
*
|
||||
* @param phoneList 手机号集合
|
||||
* @return 人员信息集合
|
||||
*/
|
||||
List<NurseStationPersonImportDTO> getAllNurseStationPersonInfo(@Param("phoneList") List<String> phoneList);
|
||||
|
||||
/**
|
||||
* 根据人员手机号查询数据库原有人员信息
|
||||
*
|
||||
* @param personPhoneList 人员手机号集合
|
||||
* @return 人员信息集合
|
||||
*/
|
||||
List<NurseStationPersonVO> getAllNurseStationPersonIdByPhone(@Param("personPhoneList") List<String> personPhoneList);
|
||||
|
||||
/**
|
||||
* 根据人员手机号查询数据库SysUser原有人员信息
|
||||
*
|
||||
* @param personPhoneList 人员手机号集合
|
||||
* @return 人员信息集合
|
||||
*/
|
||||
List<NurseStationPersonVO> selectSysUserIdByPhone(@Param("personPhoneList") List<String> personPhoneList);
|
||||
|
||||
/**
|
||||
* 批量新增护理站人员信息
|
||||
*
|
||||
* @param sysUsers 护理站人员信息
|
||||
* @return int
|
||||
**/
|
||||
int insertSysUserList(List<SysUser> sysUsers);
|
||||
|
||||
/**
|
||||
* 根据手机号查重
|
||||
*
|
||||
* @param phone 手机号
|
||||
* @return int
|
||||
**/
|
||||
NurseStationPerson getNurseStationPersonPhoneUser(String phone);
|
||||
|
||||
/**
|
||||
* 新增护理站人员同时新增sysUser
|
||||
*
|
||||
* @param nurseStationPersonSysUserVO 护理站人员信息
|
||||
* @return int
|
||||
**/
|
||||
int insertNurseStationPersonSysUser(NurseStationPersonSysUserVO nurseStationPersonSysUserVO);
|
||||
|
||||
/**
|
||||
* 修改护理站人员同时修改sysUser
|
||||
*
|
||||
* @param nurseStationPersonSysUserVO 护理站人员信息
|
||||
* @return int
|
||||
**/
|
||||
int updateNurseStationPersonSysUser(NurseStationPersonSysUserVO nurseStationPersonSysUserVO);
|
||||
|
||||
/**
|
||||
* 刪除护理站人员同时删除sysUser
|
||||
*
|
||||
* @param id 护理站人员id
|
||||
* @return int
|
||||
**/
|
||||
int deleteNurseStationPersonSysUser(Long[] id);
|
||||
|
||||
/**
|
||||
* 根据护理员id 查询用户id
|
||||
*
|
||||
* @param phone 联系电话
|
||||
* @return 修改信息
|
||||
*/
|
||||
Long getNurseStationUserId(String phone);
|
||||
|
||||
/**
|
||||
* 根据id查询护理站人员信息
|
||||
*
|
||||
* @param id 主键id
|
||||
* @return NurseStationPerson
|
||||
*/
|
||||
NurseStationPerson getNurseStationPersonInfo(Long id);
|
||||
|
||||
/**
|
||||
* 根据护理员手机号查询sysUser表的重复数量
|
||||
*
|
||||
* @param phone 联系电话
|
||||
* @return int
|
||||
**/
|
||||
int getNurseStationUserCount(String phone);
|
||||
|
||||
/**
|
||||
* 根据护理员手机号查询sysUser表
|
||||
*
|
||||
* @param phonenumber 联系电话
|
||||
* @return com.xinyilu.base.vo.nursestationperson.NurseStationPersonSysUserVO
|
||||
**/
|
||||
NurseStationPersonSysUserVO getSysUserAndPerson(String phonenumber);
|
||||
|
||||
|
||||
/**
|
||||
* 根据openid查询护理员信息
|
||||
*
|
||||
* @param openId 微信openId
|
||||
* @return com.xinyilu.base.domain.nursestationperson.NurseStationPerson
|
||||
**/
|
||||
NurseStationPerson selectNurseStationPersonOpenid(String openId);
|
||||
|
||||
|
||||
/**
|
||||
* 护理员小程序app修改护理站人员级别擅长项目信息
|
||||
*
|
||||
* @param nurseStationPerson 护理站人员信息
|
||||
* @return 结果
|
||||
*/
|
||||
int updateNursePersonCheck(NurseStationPerson nurseStationPerson);
|
||||
|
||||
/**
|
||||
* 修改护理站人员状态信息
|
||||
*
|
||||
* @param nurseStationPerson 护理站人员信息
|
||||
* @return 结果
|
||||
*/
|
||||
int updateNursePersonWorkStatus(NurseStationPerson nurseStationPerson);
|
||||
|
||||
/**
|
||||
* 根据护理员id查询平均星级评价
|
||||
*
|
||||
* @param nurseStationPersonId 护理员id
|
||||
* @return int
|
||||
**/
|
||||
int selectAvgEvaluateSatisfaction(Long nurseStationPersonId);
|
||||
|
||||
/**
|
||||
* 根据id查询护理站人员信息以及未审核的证书
|
||||
*
|
||||
* @param id 护理站人员信息主键
|
||||
* @return 护理站人员信息
|
||||
*/
|
||||
NurseStationPersonCheckDTO getNurseStationPersonCheck(Long id);
|
||||
|
||||
/**
|
||||
* 根据护理人员id去查询护理人员角色
|
||||
*
|
||||
* @param roleId 角色id
|
||||
* @param nurseStationPersonId 护理站人员id
|
||||
* @return int
|
||||
**/
|
||||
int getNurseStationPersonSysUserRole(@Param("roleId") Long roleId, @Param("nurseStationPersonId") Long nurseStationPersonId);
|
||||
|
||||
/**
|
||||
* 根据id去查
|
||||
*
|
||||
* @param nurseStationPersonIdList 护理人员id
|
||||
* @return java.util.List<com.xinyilu.base.domain.nursestationperson.NurseStationPerson>
|
||||
**/
|
||||
List<NurseStationPerson> getNurseStationPersonIdList(@Param("nurseStationPersonIdList") List<Long> nurseStationPersonIdList);
|
||||
|
||||
/**
|
||||
* 根据id修改护理员账户佣金总金额
|
||||
*
|
||||
* @param id 主键id
|
||||
* @param totalRevenueAmount 佣金金额
|
||||
* @return 数量
|
||||
*/
|
||||
int updateTotalRevenueAmountById(@Param("id") Long id, @Param("totalRevenueAmount") BigDecimal totalRevenueAmount);
|
||||
}
|
||||
@ -0,0 +1,88 @@
|
||||
package com.xinelu.manage.mapper.nursestationpersoncertificate;
|
||||
|
||||
|
||||
import com.xinelu.manage.domain.nursestationpersoncertificate.NurseStationPersonCertificate;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 护理员证书资质信息Mapper接口
|
||||
*
|
||||
* @author xinyilu
|
||||
* @date 2023-03-29
|
||||
*/
|
||||
public interface NurseStationPersonCertificateMapper {
|
||||
/**
|
||||
* 查询护理员证书资质信息
|
||||
*
|
||||
* @param id 护理员证书资质信息主键
|
||||
* @return 护理员证书资质信息
|
||||
*/
|
||||
NurseStationPersonCertificate selectNurseStationPersonCertificateById(Long id);
|
||||
|
||||
/**
|
||||
* 查询护理员证书资质信息列表
|
||||
*
|
||||
* @param nurseStationPersonCertificate 护理员证书资质信息
|
||||
* @return 护理员证书资质信息集合
|
||||
*/
|
||||
List<NurseStationPersonCertificate> selectNurseStationPersonCertificateList(NurseStationPersonCertificate nurseStationPersonCertificate);
|
||||
|
||||
/**
|
||||
* 新增护理员证书资质信息
|
||||
*
|
||||
* @param nurseStationPersonCertificate 护理员证书资质信息
|
||||
* @return 结果
|
||||
*/
|
||||
int insertNurseStationPersonCertificate(NurseStationPersonCertificate nurseStationPersonCertificate);
|
||||
|
||||
/**
|
||||
* 修改护理员证书资质信息
|
||||
*
|
||||
* @param nurseStationPersonCertificate 护理员证书资质信息
|
||||
* @return 结果
|
||||
*/
|
||||
int updateNurseStationPersonCertificate(NurseStationPersonCertificate nurseStationPersonCertificate);
|
||||
|
||||
/**
|
||||
* 删除护理员证书资质信息
|
||||
*
|
||||
* @param id 护理员证书资质信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteNurseStationPersonCertificateById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除护理员证书资质信息
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteNurseStationPersonCertificateByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 批量新增护理员证书资质信息表
|
||||
*
|
||||
* @param nurseStationPersonCertificateList 护理员证书资质信息表
|
||||
* @return int
|
||||
**/
|
||||
int insertNurseStationPersonCertificateList(List<NurseStationPersonCertificate> nurseStationPersonCertificateList);
|
||||
|
||||
/**
|
||||
* 根据护理员id查询护理员证书资质信息表
|
||||
*
|
||||
* @param nurseStationPersonIdsList 护理员证书资质信息表
|
||||
* @return int
|
||||
**/
|
||||
List<NurseStationPersonCertificate> selectNurseStationPersonCertificateByIds(@Param("nurseStationPersonIdsList") List<Long> nurseStationPersonIdsList);
|
||||
|
||||
/**
|
||||
* 根据护理员证书资质信息表id删除证书信息
|
||||
*
|
||||
* @param nurseStationPersonIds 护理员证书资质信息表id集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteNurseStationPersonCertificateByPersonIds(Long[] nurseStationPersonIds);
|
||||
}
|
||||
@ -0,0 +1,71 @@
|
||||
package com.xinelu.manage.mapper.nursestationpersoncheck;
|
||||
|
||||
|
||||
import com.xinelu.manage.domain.nursestationpersoncheck.NurseStationPersonCheck;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 护理人员信息修改审核信息(存放移动端护理员修改信息,PC端审核使用)Mapper接口
|
||||
*
|
||||
* @author xinyilu
|
||||
* @date 2023-03-29
|
||||
*/
|
||||
public interface NurseStationPersonCheckMapper {
|
||||
/**
|
||||
* 查询护理人员信息修改审核信息(存放移动端护理员修改信息,PC端审核使用)
|
||||
*
|
||||
* @param id 护理人员信息修改审核信息(存放移动端护理员修改信息,PC端审核使用)主键
|
||||
* @return 护理人员信息修改审核信息(存放移动端护理员修改信息,PC端审核使用)
|
||||
*/
|
||||
NurseStationPersonCheck selectNurseStationPersonCheckById(Long id);
|
||||
|
||||
/**
|
||||
* 查询护理人员信息修改审核信息(存放移动端护理员修改信息,PC端审核使用)列表
|
||||
*
|
||||
* @param nurseStationPersonCheck 护理人员信息修改审核信息(存放移动端护理员修改信息,PC端审核使用)
|
||||
* @return 护理人员信息修改审核信息(存放移动端护理员修改信息,PC端审核使用)集合
|
||||
*/
|
||||
List<NurseStationPersonCheck> selectNurseStationPersonCheckList(NurseStationPersonCheck nurseStationPersonCheck);
|
||||
|
||||
/**
|
||||
* 新增护理人员信息修改审核信息(存放移动端护理员修改信息,PC端审核使用)
|
||||
*
|
||||
* @param nurseStationPersonCheck 护理人员信息修改审核信息(存放移动端护理员修改信息,PC端审核使用)
|
||||
* @return 结果
|
||||
*/
|
||||
int insertNurseStationPersonCheck(NurseStationPersonCheck nurseStationPersonCheck);
|
||||
|
||||
/**
|
||||
* 修改护理人员信息修改审核信息(存放移动端护理员修改信息,PC端审核使用)
|
||||
*
|
||||
* @param nurseStationPersonCheck 护理人员信息修改审核信息(存放移动端护理员修改信息,PC端审核使用)
|
||||
* @return 结果
|
||||
*/
|
||||
int updateNurseStationPersonCheck(NurseStationPersonCheck nurseStationPersonCheck);
|
||||
|
||||
/**
|
||||
* 删除护理人员信息修改审核信息(存放移动端护理员修改信息,PC端审核使用)
|
||||
*
|
||||
* @param id 护理人员信息修改审核信息(存放移动端护理员修改信息,PC端审核使用)主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteNurseStationPersonCheckById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除护理人员信息修改审核信息(存放移动端护理员修改信息,PC端审核使用)
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteNurseStationPersonCheckByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 批量新增护理员证书资质信息表
|
||||
*
|
||||
* @param nurseStationPersonCheckList 护理员证书资质信息表
|
||||
* @return int
|
||||
**/
|
||||
int insertNurseStationPersonCheckList(List<NurseStationPersonCheck> nurseStationPersonCheckList);
|
||||
}
|
||||
@ -0,0 +1,56 @@
|
||||
package com.xinelu.manage.service.nursestationdepartment;
|
||||
|
||||
|
||||
import com.xinelu.common.core.domain.AjaxResult;
|
||||
import com.xinelu.manage.domain.nursestationdepartment.NurseStationDepartment;
|
||||
import com.xinelu.manage.vo.nursestationdepartment.NurseStationDepartmentVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 护理站部门信息Service接口
|
||||
*
|
||||
* @author zh
|
||||
* @date 2022-09-13
|
||||
*/
|
||||
public interface INurseStationDepartmentService {
|
||||
/**
|
||||
* 查询护理站部门信息
|
||||
*
|
||||
* @param id 护理站部门信息主键
|
||||
* @return 护理站部门信息
|
||||
*/
|
||||
NurseStationDepartmentVO selectNurseStationDepartmentById(Long id);
|
||||
|
||||
/**
|
||||
* 查询护理站部门信息列表
|
||||
*
|
||||
* @param nurseStationDepartment 护理站部门信息
|
||||
* @return 护理站部门信息集合
|
||||
*/
|
||||
List<NurseStationDepartmentVO> selectNurseStationDepartmentList(NurseStationDepartmentVO nurseStationDepartment);
|
||||
|
||||
/**
|
||||
* 新增护理站部门信息
|
||||
*
|
||||
* @param nurseStationDepartment 护理站部门信息
|
||||
* @return 结果
|
||||
*/
|
||||
AjaxResult insertStationDepartmentList(List<NurseStationDepartment> nurseStationDepartment);
|
||||
|
||||
/**
|
||||
* 修改护理站部门信息
|
||||
*
|
||||
* @param nurseStationDepartment 护理站部门信息
|
||||
* @return 结果
|
||||
*/
|
||||
AjaxResult updateNurseStationDepartment(NurseStationDepartment nurseStationDepartment);
|
||||
|
||||
/**
|
||||
* 批量删除护理站部门信息
|
||||
*
|
||||
* @param ids 需要删除的护理站部门信息主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteNurseStationDepartmentByIds(Long[] ids);
|
||||
}
|
||||
@ -0,0 +1,155 @@
|
||||
package com.xinelu.manage.service.nursestationdepartment.impl;
|
||||
|
||||
import com.xinelu.common.constant.Constants;
|
||||
import com.xinelu.common.core.domain.AjaxResult;
|
||||
import com.xinelu.common.exception.ServiceException;
|
||||
import com.xinelu.common.utils.SecurityUtils;
|
||||
import com.xinelu.common.utils.StringUtils;
|
||||
import com.xinelu.common.utils.codes.GenerateSystemCodeUtil;
|
||||
import com.xinelu.common.utils.regex.RegexUtil;
|
||||
import com.xinelu.manage.domain.nursestationdepartment.NurseStationDepartment;
|
||||
import com.xinelu.manage.mapper.nursestationdepartment.NurseStationDepartmentMapper;
|
||||
import com.xinelu.manage.service.nursestationdepartment.INurseStationDepartmentService;
|
||||
import com.xinelu.manage.vo.nursestationdepartment.NurseStationDepartmentVO;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.BooleanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 护理站部门信息Service业务层处理
|
||||
*
|
||||
* @author xinelu
|
||||
* @date 2022-09-13
|
||||
*/
|
||||
@Service
|
||||
public class NurseStationDepartmentServiceImpl implements INurseStationDepartmentService {
|
||||
|
||||
@Resource
|
||||
private NurseStationDepartmentMapper nurseStationDepartmentMapper;
|
||||
|
||||
@Resource
|
||||
private GenerateSystemCodeUtil generateSystemCodeUtil;
|
||||
|
||||
@Resource
|
||||
private RegexUtil regexUtil;
|
||||
|
||||
/**
|
||||
* 查询护理站部门信息
|
||||
*
|
||||
* @param id 护理站部门信息主键
|
||||
* @return 护理站部门信息
|
||||
*/
|
||||
@Override
|
||||
public NurseStationDepartmentVO selectNurseStationDepartmentById(Long id) {
|
||||
return nurseStationDepartmentMapper.selectNurseStationDepartmentById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询护理站部门信息列表
|
||||
*
|
||||
* @param nurseStationDepartment 护理站部门信息
|
||||
* @return 护理站部门信息
|
||||
*/
|
||||
@Override
|
||||
public List<NurseStationDepartmentVO> selectNurseStationDepartmentList(NurseStationDepartmentVO nurseStationDepartment) {
|
||||
return nurseStationDepartmentMapper.selectNurseStationDepartmentList(nurseStationDepartment);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增护理站部门信息
|
||||
*
|
||||
* @param nurseStationDepartment 护理站部门信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public AjaxResult insertStationDepartmentList(List<NurseStationDepartment> nurseStationDepartment) {
|
||||
if (CollectionUtils.isEmpty(nurseStationDepartment)) {
|
||||
return AjaxResult.error("请添加护理站部门信息!");
|
||||
}
|
||||
//插如数据
|
||||
for (NurseStationDepartment stationDepartment : nurseStationDepartment) {
|
||||
int nurseItemTemplateIds = nurseStationDepartmentMapper.getDepartmentName(stationDepartment.getNurseStationId(), stationDepartment.getDepartmentName());
|
||||
if (nurseItemTemplateIds > 0) {
|
||||
return AjaxResult.error(stationDepartment.getDepartmentName() + "--名称重复!");
|
||||
}
|
||||
//校验手机号
|
||||
if (StringUtils.isNotBlank(stationDepartment.getPhone())) {
|
||||
boolean regexPhone = regexUtil.regexPhone(stationDepartment.getPhone());
|
||||
if (BooleanUtils.isFalse(regexPhone)) {
|
||||
return AjaxResult.error(stationDepartment.getPhone() + "--手机号格式不正确!");
|
||||
}
|
||||
int nurseItemTemplatePhone = nurseStationDepartmentMapper.getDepartmentPhone(stationDepartment.getPhone());
|
||||
if (nurseItemTemplatePhone > 0) {
|
||||
return AjaxResult.error(stationDepartment.getPhone() + "--手机号重复!");
|
||||
}
|
||||
}
|
||||
stationDepartment.setCreateTime(LocalDateTime.now());
|
||||
stationDepartment.setCreateBy(SecurityUtils.getUsername());
|
||||
//编号生成
|
||||
stationDepartment.setDepartmentCode(Constants.NURSE_STATION_DEPARTMENT
|
||||
+ generateSystemCodeUtil.generateDepartCode(Constants.NURSE_STATION_DEPARTMENT_PREFIX));
|
||||
}
|
||||
//批量新增
|
||||
int departmentList = nurseStationDepartmentMapper.insertNurseStationDepartmentList(nurseStationDepartment);
|
||||
if (departmentList <= 0) {
|
||||
throw new ServiceException("新增护理站部门信息失败,请联系管理员!");
|
||||
}
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改护理站部门信息
|
||||
*
|
||||
* @param nurseStationDepartment 护理站部门信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult updateNurseStationDepartment(NurseStationDepartment nurseStationDepartment) {
|
||||
NurseStationDepartmentVO nurseStationDepartmentVO = nurseStationDepartmentMapper.selectNurseStationDepartmentById(nurseStationDepartment.getId());
|
||||
if (!nurseStationDepartment.getDepartmentName().equals(nurseStationDepartmentVO.getDepartmentName())) {
|
||||
int nurseItemTemplateIds = nurseStationDepartmentMapper.getDepartmentName(nurseStationDepartment.getNurseStationId(), nurseStationDepartment.getDepartmentName());
|
||||
if (nurseItemTemplateIds > 0) {
|
||||
return AjaxResult.error(nurseStationDepartment.getDepartmentName() + "--名称重复!");
|
||||
}
|
||||
}
|
||||
//校验手机号
|
||||
if (StringUtils.isNotBlank(nurseStationDepartment.getPhone())) {
|
||||
boolean regexPhone = regexUtil.regexPhone(nurseStationDepartment.getPhone());
|
||||
if (BooleanUtils.isFalse(regexPhone)) {
|
||||
return AjaxResult.error(nurseStationDepartment.getPhone() + "--手机号格式不正确!");
|
||||
}
|
||||
if (!nurseStationDepartment.getPhone().equals(nurseStationDepartmentVO.getPhone())) {
|
||||
int nurseItemTemplateId = nurseStationDepartmentMapper.getDepartmentPhone(nurseStationDepartment.getPhone());
|
||||
if (nurseItemTemplateId > 0) {
|
||||
return AjaxResult.error(nurseStationDepartment.getPhone() + "--手机号重复!");
|
||||
}
|
||||
}
|
||||
}
|
||||
nurseStationDepartment.setUpdateTime(LocalDateTime.now());
|
||||
nurseStationDepartment.setUpdateBy(SecurityUtils.getUsername());
|
||||
//修改
|
||||
int department = nurseStationDepartmentMapper.updateNurseStationDepartment(nurseStationDepartment);
|
||||
if (department <= 0) {
|
||||
throw new ServiceException("修改护理站部门信息失败,请联系管理员!");
|
||||
}
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除护理站部门信息
|
||||
*
|
||||
* @param ids 需要删除的护理站部门信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteNurseStationDepartmentByIds(Long[] ids) {
|
||||
return nurseStationDepartmentMapper.deleteNurseStationDepartmentByIds(ids);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,101 @@
|
||||
package com.xinelu.manage.service.nursestationperson;
|
||||
|
||||
import com.xinelu.common.core.domain.AjaxResult;
|
||||
import com.xinelu.manage.domain.nursestationperson.NurseStationPerson;
|
||||
import com.xinelu.manage.dto.nursestationperson.NurseStationPersonCheckDTO;
|
||||
import com.xinelu.manage.dto.nursestationperson.NurseStationPersonDTO;
|
||||
import com.xinelu.manage.dto.nursestationperson.NurseStationPersonImportDTO;
|
||||
import com.xinelu.manage.vo.nursestationperson.NurseStationPersonVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 护理站人员信息Service接口
|
||||
*
|
||||
* @author ljh
|
||||
* @date 2022-09-02
|
||||
*/
|
||||
public interface INurseStationPersonService {
|
||||
/**
|
||||
* 查询护理站人员信息
|
||||
*
|
||||
* @param id 护理站人员信息主键
|
||||
* @return 护理站人员信息
|
||||
*/
|
||||
NurseStationPersonVO selectNurseStationPersonById(Long id);
|
||||
|
||||
/**
|
||||
* 查询护理站人员信息列表
|
||||
*
|
||||
* @param nurseStationPerson 护理站人员信息
|
||||
* @return 护理站人员信息集合
|
||||
*/
|
||||
List<NurseStationPerson> selectNurseStationPersonList(NurseStationPerson nurseStationPerson);
|
||||
|
||||
/**
|
||||
* 新增护理站人员信息
|
||||
*
|
||||
* @param nurseStationPerson 护理站人员信息
|
||||
* @return 结果
|
||||
*/
|
||||
AjaxResult insertNurseStationPersonList(NurseStationPersonDTO nurseStationPerson);
|
||||
|
||||
/**
|
||||
* 修改护理站人员信息
|
||||
*
|
||||
* @param nurseStationPerson 护理站人员信息
|
||||
* @return 结果
|
||||
*/
|
||||
AjaxResult updateNurseStationPerson(NurseStationPersonDTO nurseStationPerson);
|
||||
|
||||
/**
|
||||
* 批量删除护理站人员信息
|
||||
*
|
||||
* @param ids 需要删除的护理站人员信息主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
AjaxResult deleteNurseStationPersonByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除护理站人员信息信息
|
||||
*
|
||||
* @param id 护理站人员信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteNurseStationPersonById(Long id);
|
||||
|
||||
/**
|
||||
* 查询护理站人员信息以及护理站名称集合
|
||||
*
|
||||
* @param nurseStationPerson 护理站人员信息集合
|
||||
* @return java.util.List<com.xinyilu.base.vo.nursestationperson.NurseStationPersonVO>
|
||||
**/
|
||||
List<NurseStationPersonVO> getNurseStationPersonList(NurseStationPersonVO nurseStationPerson);
|
||||
|
||||
|
||||
/**
|
||||
* 护理站人员导入
|
||||
*
|
||||
* @param nurseStationPerson 护理站人员信息
|
||||
* @return int
|
||||
**/
|
||||
AjaxResult insertNurseStationPersonImportList(List<NurseStationPersonImportDTO> nurseStationPerson);
|
||||
|
||||
|
||||
/**
|
||||
* 审核接口根据id查询护理站人员信息以及未审核的证书
|
||||
*
|
||||
* @param id 护理站人员信息主键
|
||||
* @return 护理站人员信息
|
||||
*/
|
||||
NurseStationPersonCheckDTO getNurseStationPersonCheck(Long id);
|
||||
|
||||
/**
|
||||
* 管理端更新护理人员主表信息与证书信息
|
||||
*
|
||||
* @param nurseStationPersonCheckDTO 护理人员主表信息与证书信息
|
||||
* @return AjaxResult
|
||||
* @throws Exception 异常信息
|
||||
*/
|
||||
AjaxResult updateNurseStationPersonChecks(NurseStationPersonCheckDTO nurseStationPersonCheckDTO) throws Exception;
|
||||
}
|
||||
@ -0,0 +1,695 @@
|
||||
package com.xinelu.manage.service.nursestationperson.impl;
|
||||
|
||||
|
||||
import com.xinelu.common.config.XinELuConfig;
|
||||
import com.xinelu.common.constant.Constants;
|
||||
import com.xinelu.common.core.domain.AjaxResult;
|
||||
import com.xinelu.common.core.domain.entity.SysRole;
|
||||
import com.xinelu.common.core.domain.entity.SysUser;
|
||||
import com.xinelu.common.enums.ModifyCheckStatusEnum;
|
||||
import com.xinelu.common.exception.ServiceException;
|
||||
import com.xinelu.common.utils.DateUtils;
|
||||
import com.xinelu.common.utils.SecurityUtils;
|
||||
import com.xinelu.common.utils.bean.BeanUtils;
|
||||
import com.xinelu.common.utils.codes.GenerateSystemCodeUtil;
|
||||
import com.xinelu.common.utils.regex.RegexUtil;
|
||||
import com.xinelu.common.utils.sign.Md5Utils;
|
||||
import com.xinelu.manage.domain.nursestation.NurseStation;
|
||||
import com.xinelu.manage.domain.nursestationperson.NurseStationPerson;
|
||||
import com.xinelu.manage.domain.nursestationpersoncertificate.NurseStationPersonCertificate;
|
||||
import com.xinelu.manage.domain.nursestationpersoncheck.NurseStationPersonCheck;
|
||||
import com.xinelu.manage.dto.nursestationperson.NurseStationPersonCheckDTO;
|
||||
import com.xinelu.manage.dto.nursestationperson.NurseStationPersonDTO;
|
||||
import com.xinelu.manage.dto.nursestationperson.NurseStationPersonImportDTO;
|
||||
import com.xinelu.manage.mapper.nursestation.NurseStationMapper;
|
||||
import com.xinelu.manage.mapper.nursestationperson.NurseStationPersonMapper;
|
||||
import com.xinelu.manage.mapper.nursestationpersoncertificate.NurseStationPersonCertificateMapper;
|
||||
import com.xinelu.manage.mapper.nursestationpersoncheck.NurseStationPersonCheckMapper;
|
||||
import com.xinelu.manage.service.nursestationperson.INurseStationPersonService;
|
||||
import com.xinelu.manage.vo.nursestationperson.NurseStationPersonSysUserVO;
|
||||
import com.xinelu.manage.vo.nursestationperson.NurseStationPersonVO;
|
||||
import com.xinelu.system.domain.SysUserRole;
|
||||
import com.xinelu.system.mapper.SysRoleMapper;
|
||||
import com.xinelu.system.mapper.SysUserRoleMapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.commons.lang3.BooleanUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
/**
|
||||
* 护理站人员信息Service业务层处理
|
||||
*
|
||||
* @author ljh
|
||||
* @date 2022-09-02
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class NurseStationPersonServiceImpl implements INurseStationPersonService {
|
||||
@Resource
|
||||
private RegexUtil regexUtil;
|
||||
@Resource
|
||||
private NurseStationPersonMapper nurseStationPersonMapper;
|
||||
@Resource
|
||||
private GenerateSystemCodeUtil generateSystemCodeUtil;
|
||||
@Resource
|
||||
private NurseStationMapper nurseStationMapper;
|
||||
@Resource
|
||||
private NurseStationPersonCertificateMapper nurseStationPersonCertificateMapper;
|
||||
@Resource
|
||||
private NurseStationPersonCheckMapper nurseStationPersonCheckMapper;
|
||||
@Resource
|
||||
private SysUserRoleMapper userRoleMapper;
|
||||
@Resource
|
||||
private SysRoleMapper roleMapper;
|
||||
@Resource
|
||||
private XinELuConfig xinELuConfig;
|
||||
|
||||
/**
|
||||
* 男性
|
||||
*/
|
||||
private static final String MALE_CHINESE = "男";
|
||||
|
||||
/**
|
||||
* 女性
|
||||
*/
|
||||
private static final String FEMALE_CHINESE = "女";
|
||||
|
||||
/**
|
||||
* 角色标识为护理人员
|
||||
*/
|
||||
private static final String ROLE = "nursePersonRole";
|
||||
|
||||
/**
|
||||
* 查询护理站人员信息
|
||||
*
|
||||
* @param id 护理站人员信息主键
|
||||
* @return 护理站人员信息
|
||||
*/
|
||||
@Override
|
||||
public NurseStationPersonVO selectNurseStationPersonById(Long id) {
|
||||
NurseStationPersonVO nurseStationPersonVO = nurseStationPersonMapper.selectNurseStationPersonById(id);
|
||||
int avgEvaluateSatisfaction = nurseStationPersonMapper.selectAvgEvaluateSatisfaction(id);
|
||||
nurseStationPersonVO.setEvaluateStarCount(Math.round(avgEvaluateSatisfaction));
|
||||
return nurseStationPersonVO;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询护理站人员信息列表
|
||||
*
|
||||
* @param nurseStationPerson 护理站人员信息
|
||||
* @return 护理站人员信息
|
||||
*/
|
||||
@Override
|
||||
public List<NurseStationPerson> selectNurseStationPersonList(NurseStationPerson nurseStationPerson) {
|
||||
return nurseStationPersonMapper.selectNurseStationPersonList(nurseStationPerson);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增护理站人员信息
|
||||
*
|
||||
* @param nurseStationPerson 护理站人员信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public AjaxResult insertNurseStationPersonList(NurseStationPersonDTO nurseStationPerson) {
|
||||
//校验数据是否为空
|
||||
if (Objects.isNull(nurseStationPerson)) {
|
||||
return AjaxResult.error("请添加护理站人员信息!");
|
||||
}
|
||||
//校验手机号是否正确
|
||||
if (StringUtils.isNotBlank(nurseStationPerson.getPhone())) {
|
||||
boolean regexPhone = regexUtil.regexPhone(nurseStationPerson.getPhone());
|
||||
if (BooleanUtils.isFalse(regexPhone)) {
|
||||
return AjaxResult.error("您输入的联系电话" + nurseStationPerson.getPhone() + "不正确,请重新输入!");
|
||||
}
|
||||
// 校验手机号是否重复
|
||||
int nurseStationPersonPhone = nurseStationPersonMapper.getNurseStationPersonPhone(nurseStationPerson.getPhone());
|
||||
if (nurseStationPersonPhone > 0) {
|
||||
log.warn("新增当前护理员手机号信息在nurse_station_person表中存在重复!!");
|
||||
return AjaxResult.error("您输入的联系电话" + nurseStationPerson.getPhone() + "重复!");
|
||||
}
|
||||
//根据手机号查询sysUser表的信息 是否重复
|
||||
int nurseStationUserCount = nurseStationPersonMapper.getNurseStationUserCount(nurseStationPerson.getPhone());
|
||||
if (nurseStationUserCount > 0) {
|
||||
return AjaxResult.error("您输入的联系电话" + nurseStationPerson.getPhone() + "在用户管理中重复!");
|
||||
}
|
||||
}
|
||||
// 设置创建人创建时间以及随机生成唯一编码
|
||||
nurseStationPerson.setModifyCheckStatus(ModifyCheckStatusEnum.CHECKED.getInfo());
|
||||
nurseStationPerson.setCreateTime(LocalDateTime.now());
|
||||
nurseStationPerson.setCreateBy(SecurityUtils.getUsername());
|
||||
nurseStationPerson.setUserId(SecurityUtils.getUserId());
|
||||
nurseStationPerson.setNursePersonCode(Constants.NURSE_PERSON_CODE + generateSystemCodeUtil.generateSystemCode(Constants.NURSE_PERSON_CODE));
|
||||
int insertCount = nurseStationPersonMapper.insertNurseStationPerson(nurseStationPerson);
|
||||
if (insertCount <= 0) {
|
||||
throw new ServiceException("新增护理人员信息失败,请联系管理员!");
|
||||
}
|
||||
//新增sys_user表信息
|
||||
this.insertSysUserInfo(nurseStationPerson);
|
||||
if (CollectionUtils.isNotEmpty(nurseStationPerson.getNurseStationPersonCertificateList())) {
|
||||
//新增护理员证书表
|
||||
for (NurseStationPersonCertificate personCertificate : nurseStationPerson.getNurseStationPersonCertificateList()) {
|
||||
personCertificate.setNurseStationPersonId(nurseStationPerson.getId());
|
||||
personCertificate.setCreateTime(LocalDateTime.now());
|
||||
personCertificate.setCreateBy(SecurityUtils.getUsername());
|
||||
personCertificate.setCertificateCode(Constants.PERSON_CERTIFICATE_CODE + generateSystemCodeUtil.generateSystemCode(Constants.PERSON_CERTIFICATE_CODE));
|
||||
}
|
||||
int nurseStationPersonCertificateList = nurseStationPersonCertificateMapper.insertNurseStationPersonCertificateList(nurseStationPerson.getNurseStationPersonCertificateList());
|
||||
if (nurseStationPersonCertificateList <= 0) {
|
||||
throw new ServiceException("新增护理员证书信息失败,请联系管理员!");
|
||||
}
|
||||
}
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改护理站人员信息
|
||||
*
|
||||
* @param nurseStationPerson 护理站人员信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public AjaxResult updateNurseStationPerson(NurseStationPersonDTO nurseStationPerson) {
|
||||
//根据id查询当前人员是否存在
|
||||
NurseStationPerson existStationPerson = nurseStationPersonMapper.getNurseStationPersonInfo(nurseStationPerson.getId());
|
||||
if (Objects.isNull(existStationPerson)) {
|
||||
return AjaxResult.error("当前护理站人员信息不存在!");
|
||||
}
|
||||
if (StringUtils.isNotBlank(nurseStationPerson.getPhone())) {
|
||||
// 校验手机号是否正确
|
||||
boolean regexPhone = regexUtil.regexPhone(nurseStationPerson.getPhone());
|
||||
if (BooleanUtils.isFalse(regexPhone)) {
|
||||
return AjaxResult.error("您输入的联系电话" + nurseStationPerson.getPhone() + "不正确,请重新输入!");
|
||||
}
|
||||
// 校验手机号是否重复
|
||||
boolean existStationPhone = StringUtils.isNotBlank(existStationPerson.getPhone()) && StringUtils.isNotBlank(nurseStationPerson.getPhone()) && !existStationPerson.getPhone().equals(nurseStationPerson.getPhone());
|
||||
if (BooleanUtils.isTrue(existStationPhone)) {
|
||||
int nurseStationPersonPhone = nurseStationPersonMapper.getNurseStationPersonPhone(nurseStationPerson.getPhone());
|
||||
if (nurseStationPersonPhone > 0) {
|
||||
return AjaxResult.error("您输入的联系电话" + nurseStationPerson.getPhone() + "重复,请重新输入!");
|
||||
}
|
||||
//根据手机号查询sysUser表的信息 是否重复
|
||||
int nurseStationUserCount = nurseStationPersonMapper.getNurseStationUserCount(nurseStationPerson.getPhone());
|
||||
if (nurseStationUserCount > 0) {
|
||||
return AjaxResult.error("您输入的联系电话" + nurseStationPerson.getPhone() + "在用户管理中重复!");
|
||||
}
|
||||
}
|
||||
}
|
||||
//更新护理人员表信息
|
||||
nurseStationPerson.setUpdateBy(SecurityUtils.getUsername());
|
||||
nurseStationPerson.setUpdateTime(LocalDateTime.now());
|
||||
int stationPerson = nurseStationPersonMapper.updateNurseStationPerson(nurseStationPerson);
|
||||
if (stationPerson <= 0) {
|
||||
throw new ServiceException("修改护理人员失败,请联系管理员!");
|
||||
}
|
||||
//修改sys_user表信息
|
||||
this.updateSysUserInfo(nurseStationPerson, existStationPerson);
|
||||
//修改护理人员证书
|
||||
this.extracted(nurseStationPerson);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除护理站人员信息
|
||||
*
|
||||
* @param ids 需要删除的护理站人员信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public AjaxResult deleteNurseStationPersonByIds(Long[] ids) {
|
||||
//根据护理人员id去查询对应的资质证书 使用流来获取所有的证书路径
|
||||
List<NurseStationPersonCertificate> stationPersonCertificates = nurseStationPersonCertificateMapper.selectNurseStationPersonCertificateByIds(Arrays.asList(ids));
|
||||
//删除人员资质证书表信息
|
||||
if (CollectionUtils.isNotEmpty(stationPersonCertificates)) {
|
||||
nurseStationPersonCertificateMapper.deleteNurseStationPersonCertificateByPersonIds(ids);
|
||||
}
|
||||
//删除sysUser表信息
|
||||
nurseStationPersonMapper.deleteNurseStationPersonSysUser(ids);
|
||||
//删除nurse_station_person表信息
|
||||
int stationPersonByIds = nurseStationPersonMapper.deleteNurseStationPersonByIds(ids);
|
||||
if (stationPersonByIds <= 0) {
|
||||
return AjaxResult.error("删除护理人员信息失败!");
|
||||
}
|
||||
//删除护理人员的资质证书
|
||||
if (CollectionUtils.isNotEmpty(stationPersonCertificates)) {
|
||||
List<String> personCertificateUrlList = stationPersonCertificates.stream().filter(Objects::nonNull)
|
||||
.filter(hospitalUrl -> (StringUtils.isNotBlank(hospitalUrl.getCertificateUrl())))
|
||||
.map(NurseStationPersonCertificate::getCertificateUrl).collect(Collectors.toList());
|
||||
if (CollectionUtils.isNotEmpty(personCertificateUrlList)) {
|
||||
personCertificateUrlList.forEach(this::deletePictureUrl);
|
||||
}
|
||||
}
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除护理站人员信息信息
|
||||
*
|
||||
* @param id 护理站人员信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteNurseStationPersonById(Long id) {
|
||||
return nurseStationPersonMapper.deleteNurseStationPersonById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询护理站人员信息以及护理站名称集合
|
||||
*
|
||||
* @param nurseStationPerson 护理站人员信息集合
|
||||
* @return java.util.List<com.xinelu.common.vo.nursestationperson.NurseStationPersonVO>
|
||||
**/
|
||||
@Override
|
||||
public List<NurseStationPersonVO> getNurseStationPersonList(NurseStationPersonVO nurseStationPerson) {
|
||||
List<NurseStationPersonVO> nurseStationPersonList = nurseStationPersonMapper.getNurseStationPersonList(nurseStationPerson);
|
||||
if (CollectionUtils.isNotEmpty(nurseStationPersonList)) {
|
||||
nurseStationPersonList.forEach(nurse -> {
|
||||
int avgEvaluateSatisfaction = nurseStationPersonMapper.selectAvgEvaluateSatisfaction(nurse.getId());
|
||||
nurse.setEvaluateStarCount(Math.round(avgEvaluateSatisfaction));
|
||||
});
|
||||
}
|
||||
return nurseStationPersonList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 护理站人员导入
|
||||
*
|
||||
* @param nurseStationPerson 护理站人员信息
|
||||
* @return 导入结果信息
|
||||
**/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public AjaxResult insertNurseStationPersonImportList(List<NurseStationPersonImportDTO> nurseStationPerson) {
|
||||
//获取当前用户 校验数据是否有值
|
||||
if (CollectionUtils.isEmpty(nurseStationPerson)) {
|
||||
return AjaxResult.error("请添加护理站人员信息!");
|
||||
}
|
||||
NurseStationPersonImportDTO nurseStationPersonImportDTO = nurseStationPerson.stream()
|
||||
.filter(item -> StringUtils.isBlank(item.getNursePersonName()) || StringUtils.isBlank(item.getSex()) || StringUtils.isBlank(item.getPhone()) || StringUtils.isBlank(item.getNurseStationName()))
|
||||
.findFirst().orElse(null);
|
||||
if (Objects.nonNull(nurseStationPersonImportDTO)) {
|
||||
return AjaxResult.error("导入数据格式不正确,单元格数据不能为空,请进行确认!");
|
||||
}
|
||||
//根据人员姓名、联系电话、所属护理站去重
|
||||
List<NurseStationPersonImportDTO> nursePersonList = nurseStationPerson.stream().filter(Objects::nonNull).distinct().collect(Collectors.toList());
|
||||
//校验联系电话格式是否正确
|
||||
NurseStationPersonImportDTO dto = nursePersonList.stream().filter(item -> StringUtils.isNotBlank(item.getPhone())).filter(item -> BooleanUtils.isFalse(regexUtil.regexPhone(item.getPhone()))).findFirst().orElse(new NurseStationPersonImportDTO());
|
||||
if (StringUtils.isNotBlank(dto.getPhone())) {
|
||||
return AjaxResult.error("当前联系电话:" + dto.getPhone() + " 格式不正确,请重新录入!");
|
||||
}
|
||||
//获取护理人员的手机号集合
|
||||
List<String> phoneList = nursePersonList.stream()
|
||||
.filter(Objects::nonNull)
|
||||
.filter(item -> Objects.nonNull(item.getPhone()))
|
||||
.map(NurseStationPersonImportDTO::getPhone)
|
||||
.distinct().collect(Collectors.toList());
|
||||
//根据人员手机号查询数据库已存在的人员信息和所属护理站信息
|
||||
List<NurseStationPersonImportDTO> allNurseStationPersonInfo = nurseStationPersonMapper.getAllNurseStationPersonInfo(phoneList);
|
||||
//做差集,剔除数据库中已经存在的人员信息
|
||||
List<NurseStationPersonImportDTO> subtractList = new ArrayList<>(CollectionUtils.subtract(nursePersonList, allNurseStationPersonInfo));
|
||||
if (CollectionUtils.isEmpty(subtractList)) {
|
||||
return AjaxResult.success();
|
||||
}
|
||||
//获取护理站的名称
|
||||
List<String> stationNameList = subtractList.stream()
|
||||
.filter(Objects::nonNull)
|
||||
.filter(item -> Objects.nonNull(item.getNurseStationName()))
|
||||
.map(NurseStationPersonImportDTO::getNurseStationName)
|
||||
.distinct().collect(Collectors.toList());
|
||||
//获取到所有的护理站信息
|
||||
List<NurseStation> nurseStationList = nurseStationMapper.selectNurseStationListByNames(stationNameList);
|
||||
//查询护理站相关信息
|
||||
Map<String, Long> nurseStationMap = nurseStationList.stream().filter(Objects::nonNull)
|
||||
.filter(item -> StringUtils.isNotBlank(item.getNurseStationName()))
|
||||
.collect(Collectors.toMap(NurseStation::getNurseStationName, NurseStation::getId));
|
||||
// 设置其余编号以及系统值
|
||||
List<NurseStationPerson> nurseStationPersonList = new ArrayList<>();
|
||||
for (NurseStationPersonImportDTO item : subtractList) {
|
||||
String sex = StringUtils.isBlank(item.getSex()) ? "" : item.getSex();
|
||||
if (MALE_CHINESE.equals(sex)) {
|
||||
item.setSex(Constants.MALE);
|
||||
}
|
||||
if (FEMALE_CHINESE.equals(sex)) {
|
||||
item.setSex(Constants.FEMALE);
|
||||
}
|
||||
item.setNurseStationId(nurseStationMap.getOrDefault(item.getNurseStationName(), null));
|
||||
item.setCreateBy(SecurityUtils.getUsername());
|
||||
item.setCreateTime(LocalDateTime.now());
|
||||
item.setUserId(SecurityUtils.getUserId());
|
||||
item.setNursePersonCode(Constants.NURSE_PERSON_CODE + generateSystemCodeUtil.generateSystemCode(Constants.NURSE_PERSON_CODE));
|
||||
NurseStationPerson stationPerson = new NurseStationPerson();
|
||||
BeanUtils.copyProperties(item, stationPerson);
|
||||
nurseStationPersonList.add(stationPerson);
|
||||
}
|
||||
int insertCount = nurseStationPersonMapper.insertNurseStationPersonImportList(nurseStationPersonList);
|
||||
if (insertCount <= 0) {
|
||||
throw new ServiceException("导入护理站人员信息失败,请联系管理员!");
|
||||
}
|
||||
//导入到用户表
|
||||
this.insertSysUser(subtractList);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 审核接口根据id查询护理站人员信息以及未审核的证书
|
||||
*
|
||||
* @param id 护理站人员信息主键
|
||||
* @return 护理站人员信息
|
||||
*/
|
||||
@Override
|
||||
public NurseStationPersonCheckDTO getNurseStationPersonCheck(Long id) {
|
||||
return nurseStationPersonMapper.getNurseStationPersonCheck(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 管理端更新护理人员主表信息与证书信息
|
||||
*
|
||||
* @param nurseStationPersonCheckDTO 护理人员主表信息与证书信息
|
||||
* @return AjaxResult
|
||||
* @throws Exception 异常信息
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public AjaxResult updateNurseStationPersonChecks(NurseStationPersonCheckDTO nurseStationPersonCheckDTO) throws Exception {
|
||||
//已审核才能进行修改
|
||||
if (!StringUtils.equals(ModifyCheckStatusEnum.CHECKED.getInfo(), nurseStationPersonCheckDTO.getModifyCheckStatus())) {
|
||||
return AjaxResult.success();
|
||||
}
|
||||
//更新护理人员主表信息
|
||||
nurseStationPersonCheckDTO.setModifyInfoFlag(0);
|
||||
int personWorkStatusAndCheck = nurseStationPersonMapper.updateNurseStationPerson(nurseStationPersonCheckDTO);
|
||||
if (personWorkStatusAndCheck <= 0) {
|
||||
log.error("更新护理人员主表信息失败,请联系管理员!");
|
||||
throw new ServiceException("审核护理员信息失败,请联系管理员!");
|
||||
}
|
||||
//根据护理人员id去查询已审核证书表信息,nurse_station_person_certificate
|
||||
NurseStationPersonCertificate nurseStationPersonCertificate = new NurseStationPersonCertificate();
|
||||
nurseStationPersonCertificate.setNurseStationPersonId(nurseStationPersonCheckDTO.getId());
|
||||
List<NurseStationPersonCertificate> nurseStationPersonCertificates = nurseStationPersonCertificateMapper.selectNurseStationPersonCertificateList(nurseStationPersonCertificate);
|
||||
//根据护理人员id去查询待审核证书表信息,nurse_station_person_check
|
||||
NurseStationPersonCheck nurseStationPersonCheck = new NurseStationPersonCheck();
|
||||
nurseStationPersonCheck.setNurseStationPersonId(nurseStationPersonCheckDTO.getId());
|
||||
List<NurseStationPersonCheck> nurseStationPersonChecks = nurseStationPersonCheckMapper.selectNurseStationPersonCheckList(nurseStationPersonCheck);
|
||||
//刪除已审核与待审核证书表信息,并批量新增nurse_station_person_certificate表信息
|
||||
deleteCertificate(nurseStationPersonCheckDTO, nurseStationPersonCertificates, nurseStationPersonChecks);
|
||||
//将待审核文件信息复制到已审核文件路径下,并删除多余文件
|
||||
deleteCertificateFile(nurseStationPersonCertificates, nurseStationPersonChecks);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 刪除已审核与待审核证书表信息,并批量新增nurse_station_person_certificate表信息
|
||||
*
|
||||
* @param nurseStationPersonCheckDTO 护理人员主表信息与证书信息
|
||||
* @param nurseStationPersonCertificates 已审核证书信息
|
||||
* @param nurseStationPersonChecks 待审核证书信息
|
||||
**/
|
||||
private void deleteCertificate(NurseStationPersonCheckDTO nurseStationPersonCheckDTO, List<NurseStationPersonCertificate> nurseStationPersonCertificates, List<NurseStationPersonCheck> nurseStationPersonChecks) throws IOException {
|
||||
//删除已审核证书表信息,nurse_station_person_certificate
|
||||
if (CollectionUtils.isNotEmpty(nurseStationPersonCertificates)) {
|
||||
Long[] longList = nurseStationPersonCertificates.stream().filter(Objects::nonNull).filter(check -> (Objects.nonNull(check.getId()))).map(NurseStationPersonCertificate::getId).toArray(Long[]::new);
|
||||
int deleteNurseStationPersonCertificates = nurseStationPersonCertificateMapper.deleteNurseStationPersonCertificateByIds(longList);
|
||||
if (deleteNurseStationPersonCertificates <= 0) {
|
||||
log.error("删除护理人员信息证书信息表失败,请联系管理员!");
|
||||
throw new ServiceException("审核护理员信息失败,请联系管理员!");
|
||||
}
|
||||
}
|
||||
//删除待审核证书表信息,nurse_station_person_check
|
||||
if (CollectionUtils.isNotEmpty(nurseStationPersonChecks)) {
|
||||
Long[] longList = nurseStationPersonChecks.stream().filter(Objects::nonNull).filter(check -> (Objects.nonNull(check.getId()))).map(NurseStationPersonCheck::getId).toArray(Long[]::new);
|
||||
int deleteNurseStationPersonCheckByIds = nurseStationPersonCheckMapper.deleteNurseStationPersonCheckByIds(longList);
|
||||
if (deleteNurseStationPersonCheckByIds <= 0) {
|
||||
log.error("删除护理人员信息修改审核信息表失败,请联系管理员!");
|
||||
throw new ServiceException("审核护理员信息失败,请联系管理员!");
|
||||
}
|
||||
}
|
||||
//将nurse_station_person_check表信息同步到nurse_station_person_certificate表中
|
||||
if (CollectionUtils.isNotEmpty(nurseStationPersonCheckDTO.getNurseStationPersonCheckList())) {
|
||||
List<NurseStationPersonCertificate> nurseStationPersonCertificateList = new ArrayList<>();
|
||||
nurseStationPersonCheckDTO.getNurseStationPersonCheckList().forEach(item -> {
|
||||
NurseStationPersonCertificate stationPersonCertificate = new NurseStationPersonCertificate();
|
||||
stationPersonCertificate.setNurseStationPersonId(item.getNurseStationPersonId());
|
||||
stationPersonCertificate.setCertificateName(StringUtils.isBlank(item.getCertificateName()) ? "" : item.getCertificateName());
|
||||
//人员信息证书表的地址
|
||||
String certificate = item.getCertificateUrl().replaceAll(xinELuConfig.getPersonCertificateCheckUrl(), xinELuConfig.getPersonCertificateUrl());
|
||||
stationPersonCertificate.setCertificateUrl(certificate);
|
||||
stationPersonCertificate.setCertificateCode(StringUtils.isBlank(item.getCertificateCode()) ? "" : item.getCertificateCode());
|
||||
stationPersonCertificate.setSort(Objects.isNull(item.getSort()) ? null : item.getSort());
|
||||
stationPersonCertificate.setCreateTime(LocalDateTime.now());
|
||||
nurseStationPersonCertificateList.add(stationPersonCertificate);
|
||||
});
|
||||
if (CollectionUtils.isNotEmpty(nurseStationPersonCertificateList)) {
|
||||
//批量新增nurse_station_person_certificate表信息
|
||||
int stationPersonCheckList = nurseStationPersonCertificateMapper.insertNurseStationPersonCertificateList(nurseStationPersonCertificateList);
|
||||
if (stationPersonCheckList <= 0) {
|
||||
log.error("更新护理人员信息证书信息表失败,请联系管理员!");
|
||||
throw new ServiceException("审核护理员信息失败,请联系管理员!");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 将待审核文件信息复制到已审核文件路径下,并删除多余文件
|
||||
*
|
||||
* @param nurseStationPersonCertificates 已审核证书信息
|
||||
* @param nurseStationPersonChecks 待审核证书信息
|
||||
**/
|
||||
private void deleteCertificateFile(List<NurseStationPersonCertificate> nurseStationPersonCertificates, List<NurseStationPersonCheck> nurseStationPersonChecks) throws IOException {
|
||||
//筛选已审核人员信息证书表的地址,例如:[1,2]
|
||||
List<String> certificateUrlList = nurseStationPersonCertificates.stream().filter(Objects::nonNull).map(NurseStationPersonCertificate::getCertificateUrl).filter(StringUtils::isNotBlank).collect(Collectors.toList());
|
||||
//筛选出待审核人员信息证书表的地址,例如:[1,3]
|
||||
List<String> certificateCheckUrlList = nurseStationPersonChecks.stream().filter(Objects::nonNull).map(NurseStationPersonCheck::getCertificateUrl).filter(StringUtils::isNotBlank).collect(Collectors.toList());
|
||||
//交集,筛选已审核表中已存在的并且未删除的证书路径,交集:[1]
|
||||
List<String> intersectionCertificateUrlList = new ArrayList<>(CollectionUtils.intersection(certificateUrlList, certificateCheckUrlList));
|
||||
//差集,筛选出需要删除的已审核路径下的文件地址,差集:[2]
|
||||
List<String> subtractCertificateList = new ArrayList<>(CollectionUtils.subtract(certificateUrlList, intersectionCertificateUrlList));
|
||||
//差集,筛选出需要删除的待审核路径下的文件地址,差集:[3]
|
||||
List<String> certificateCheckList = new ArrayList<>(CollectionUtils.subtract(certificateCheckUrlList, certificateUrlList));
|
||||
//删除已审核证书路径下图片信息
|
||||
if (subtractCertificateList.size() > 0) {
|
||||
for (String certificateUrl : subtractCertificateList) {
|
||||
com.xinelu.common.utils.file.FileUtils.deleteSystemFile(certificateUrl);
|
||||
}
|
||||
}
|
||||
//将待审核文件信息复制到已审核文件路径下,并且删除待审核的图片信息
|
||||
for (String certificateCheckUrl : certificateCheckList) {
|
||||
//待审核信息证书文件地址
|
||||
String certificateCheck = XinELuConfig.getProfile() + certificateCheckUrl.replaceAll("/profile", "");
|
||||
//已审核人员信息证书文件地址
|
||||
String certificate = certificateCheck.replaceAll(xinELuConfig.getPersonCertificateCheckUrl(), xinELuConfig.getPersonCertificateUrl());
|
||||
File certificateCheckFile = new File(certificateCheck);
|
||||
File certificateFile = new File(certificate);
|
||||
//存在则复制
|
||||
if (certificateCheckFile.exists()) {
|
||||
FileUtils.copyFile(certificateCheckFile, certificateFile);
|
||||
}
|
||||
//刪除待审核路径下证书图片
|
||||
com.xinelu.common.utils.file.FileUtils.deleteSystemFile(certificateCheckUrl);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 导入Sys_user表
|
||||
*
|
||||
* @param subtractList 手机号列表
|
||||
*/
|
||||
private void insertSysUser(List<NurseStationPersonImportDTO> subtractList) {
|
||||
//获取护理人员的手机号集合
|
||||
List<String> personPhoneList = subtractList.stream().filter(item -> StringUtils.isNotBlank(item.getPhone())).map(NurseStationPersonImportDTO::getPhone).collect(Collectors.toList());
|
||||
//查询新增护理员信息
|
||||
List<SysUser> sysUsers = new ArrayList<>();
|
||||
List<NurseStationPersonVO> allNurseStationPerson = nurseStationPersonMapper.getAllNurseStationPersonIdByPhone(personPhoneList);
|
||||
//查询SysUser表信息
|
||||
List<NurseStationPersonVO> sysUserPhoneList = nurseStationPersonMapper.selectSysUserIdByPhone(personPhoneList);
|
||||
//做差集,剔除数据库中已经存在的人员信息
|
||||
List<NurseStationPersonVO> sysUserSubtractList = new ArrayList<>(CollectionUtils.subtract(allNurseStationPerson, sysUserPhoneList));
|
||||
if (CollectionUtils.isEmpty(sysUserSubtractList)) {
|
||||
return;
|
||||
}
|
||||
//新增用户信息
|
||||
for (NurseStationPersonVO stationPerson : sysUserSubtractList) {
|
||||
SysUser sysUser = new SysUser();
|
||||
String sex = StringUtils.isBlank(stationPerson.getSex()) ? "" : stationPerson.getSex();
|
||||
if (Constants.MALE.equals(sex)) {
|
||||
sysUser.setSex(Constants.SYS_USER_MALE);
|
||||
}
|
||||
if (Constants.FEMALE.equals(sex)) {
|
||||
sysUser.setSex(Constants.SYS_USER_FEMALE);
|
||||
}
|
||||
sysUser.setUserName(stationPerson.getNursePersonName());
|
||||
sysUser.setNickName(stationPerson.getNursePersonName());
|
||||
sysUser.setPhonenumber(stationPerson.getPhone());
|
||||
sysUser.setNurseStationPersonId(stationPerson.getId());
|
||||
sysUser.setPassword(SecurityUtils.encryptPassword(Constants.PASS_WORD));
|
||||
sysUser.setStationPersonPassword(Md5Utils.hash(Constants.PASS_WORD));
|
||||
sysUser.setDelFlag("0");
|
||||
sysUser.setStatus("0");
|
||||
sysUser.setNurseStationIds(Objects.isNull(stationPerson.getNurseStationId()) ? null : stationPerson.getNurseStationId().toString());
|
||||
sysUser.setCreateTime(DateUtils.getNowDate());
|
||||
sysUser.setCreateBy(SecurityUtils.getUsername());
|
||||
sysUsers.add(sysUser);
|
||||
}
|
||||
int insert = nurseStationPersonMapper.insertSysUserList(sysUsers);
|
||||
if (insert <= 0) {
|
||||
throw new ServiceException("导入用户信息失败,请联系管理员!");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增sys_user表信息
|
||||
*
|
||||
* @param object 参数
|
||||
*/
|
||||
private void insertSysUserInfo(NurseStationPerson object) {
|
||||
NurseStationPersonSysUserVO nurseStationPersonSysUser = new NurseStationPersonSysUserVO();
|
||||
nurseStationPersonSysUser.setUserName(object.getPhone());
|
||||
nurseStationPersonSysUser.setPhonenumber(object.getPhone());
|
||||
nurseStationPersonSysUser.setNickName(object.getNursePersonName());
|
||||
if (object.getSex().equals(Constants.MALE)) {
|
||||
nurseStationPersonSysUser.setSex("0");
|
||||
} else {
|
||||
nurseStationPersonSysUser.setSex("1");
|
||||
}
|
||||
nurseStationPersonSysUser.setPassword(SecurityUtils.encryptPassword(Constants.PASS_WORD));
|
||||
nurseStationPersonSysUser.setStationPersonPassword(Md5Utils.hash((Constants.PASS_WORD)));
|
||||
nurseStationPersonSysUser.setStatus("0");
|
||||
nurseStationPersonSysUser.setDelFlag("0");
|
||||
nurseStationPersonSysUser.setCreateTime(LocalDateTime.now());
|
||||
nurseStationPersonSysUser.setCreateBy(SecurityUtils.getUsername());
|
||||
nurseStationPersonSysUser.setNurseStationIds(String.valueOf(object.getNurseStationId()));
|
||||
nurseStationPersonSysUser.setNurseStationPersonId(object.getId());
|
||||
int stationPersonSysUser = nurseStationPersonMapper.insertNurseStationPersonSysUser(nurseStationPersonSysUser);
|
||||
if (stationPersonSysUser <= 0) {
|
||||
throw new ServiceException("新增护理人员用户信息失败,请联系管理员!");
|
||||
}
|
||||
//新增角色信息
|
||||
SysRole sysRole = roleMapper.checkRoleKeyUnique(ROLE);
|
||||
if (Objects.nonNull(sysRole)) {
|
||||
SysUserRole sysUserRole = new SysUserRole();
|
||||
sysUserRole.setUserId(nurseStationPersonSysUser.getUserId());
|
||||
sysUserRole.setRoleId(sysRole.getRoleId());
|
||||
int userRole = userRoleMapper.insertSysUserRole(sysUserRole);
|
||||
if (userRole <= 0) {
|
||||
throw new ServiceException("新增角色信息失败,请联系管理员!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改护理人员证书
|
||||
*
|
||||
* @param nurseStationPerson 人员信息
|
||||
**/
|
||||
private void extracted(NurseStationPersonDTO nurseStationPerson) {
|
||||
//查询原有的证书信息
|
||||
List<NurseStationPersonCertificate> stationPersonCertificates = nurseStationPersonCertificateMapper.selectNurseStationPersonCertificateByIds(Collections.singletonList(nurseStationPerson.getId()));
|
||||
//删除原有证书信息
|
||||
if (CollectionUtils.isNotEmpty(stationPersonCertificates)) {
|
||||
Long[] longs = stationPersonCertificates.stream().filter(Objects::nonNull).filter(item -> Objects.nonNull(item.getId())).collect(Collectors.toList()).stream().map(NurseStationPersonCertificate::getId).toArray(Long[]::new);
|
||||
int deleteCount = nurseStationPersonCertificateMapper.deleteNurseStationPersonCertificateByIds(longs);
|
||||
if (deleteCount <= 0) {
|
||||
throw new ServiceException("修改护理人员证书信息失败,请联系管理员!");
|
||||
}
|
||||
}
|
||||
//页面传值
|
||||
List<NurseStationPersonCertificate> personCertificateListVO = nurseStationPerson.getNurseStationPersonCertificateList();
|
||||
//新增护理人员资质证书表
|
||||
if (CollectionUtils.isNotEmpty(personCertificateListVO)) {
|
||||
for (NurseStationPersonCertificate nurseStationPersonCertificate : personCertificateListVO) {
|
||||
nurseStationPersonCertificate.setNurseStationPersonId(nurseStationPerson.getId());
|
||||
nurseStationPersonCertificate.setUpdateTime(LocalDateTime.now());
|
||||
nurseStationPersonCertificate.setUpdateBy(SecurityUtils.getUsername());
|
||||
nurseStationPersonCertificate.setCertificateCode(Constants.PERSON_CERTIFICATE_CODE + generateSystemCodeUtil.generateSystemCode(Constants.PERSON_CERTIFICATE_CODE));
|
||||
}
|
||||
int hospitalPersonCertificates = nurseStationPersonCertificateMapper.insertNurseStationPersonCertificateList(nurseStationPerson.getNurseStationPersonCertificateList());
|
||||
if (hospitalPersonCertificates <= 0) {
|
||||
throw new ServiceException("修改护理人员资质证书信息失败,请联系管理员!");
|
||||
}
|
||||
}
|
||||
//删除护理人员的资质证书地址
|
||||
List<NurseStationPersonCertificate> deletePersonCertificateList = new ArrayList<>(CollectionUtils.subtract(stationPersonCertificates, personCertificateListVO));
|
||||
if (CollectionUtils.isNotEmpty(deletePersonCertificateList)) {
|
||||
List<String> certificateUrlList = deletePersonCertificateList.stream().filter(Objects::nonNull)
|
||||
.filter(item -> (StringUtils.isNotBlank(item.getCertificateUrl())))
|
||||
.map(NurseStationPersonCertificate::getCertificateUrl).collect(Collectors.toList());
|
||||
certificateUrlList.forEach(this::deletePictureUrl);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改sys_user表信息
|
||||
*
|
||||
* @param nurseStationPerson 前端输入参数
|
||||
* @param existStationPerson 数据库参数
|
||||
*/
|
||||
private void updateSysUserInfo(NurseStationPerson nurseStationPerson, NurseStationPerson existStationPerson) {
|
||||
//根据手机号查询sysUser表中的id 判断是否存在
|
||||
NurseStationPersonSysUserVO sysUserAndPerson = nurseStationPersonMapper.getSysUserAndPerson(existStationPerson.getPhone());
|
||||
if (Objects.nonNull(sysUserAndPerson) && Objects.nonNull(sysUserAndPerson.getUserId())) {
|
||||
boolean existPhone = StringUtils.isNotBlank(nurseStationPerson.getPhone()) && StringUtils.isNotBlank(sysUserAndPerson.getPhonenumber()) && !sysUserAndPerson.getPhonenumber().equals(nurseStationPerson.getPhone());
|
||||
if (BooleanUtils.isTrue(existPhone)) {
|
||||
//根据手机号查询sysUser表的信息 是否重复
|
||||
int nurseStationUserCount = nurseStationPersonMapper.getNurseStationUserCount(nurseStationPerson.getPhone());
|
||||
if (nurseStationUserCount > 0) {
|
||||
log.warn("修改当前护理员手机号信息在sys_user表中存在重复!");
|
||||
throw new ServiceException("您输入的联系电话" + nurseStationPerson.getPhone() + "重复,请重新输入!");
|
||||
}
|
||||
}
|
||||
//修改sys_user表信息
|
||||
NurseStationPersonSysUserVO nurseStationPersonSysUser = new NurseStationPersonSysUserVO();
|
||||
nurseStationPersonSysUser.setUserName(nurseStationPerson.getPhone());
|
||||
nurseStationPersonSysUser.setPhonenumber(nurseStationPerson.getPhone());
|
||||
nurseStationPersonSysUser.setNickName(nurseStationPerson.getNursePersonName());
|
||||
if (nurseStationPerson.getSex().equals(Constants.MALE)) {
|
||||
nurseStationPersonSysUser.setSex("0");
|
||||
} else {
|
||||
nurseStationPersonSysUser.setSex("1");
|
||||
}
|
||||
nurseStationPersonSysUser.setUpdateTime(LocalDateTime.now());
|
||||
nurseStationPersonSysUser.setUpdateBy(SecurityUtils.getUsername());
|
||||
nurseStationPersonSysUser.setNurseStationIds(String.valueOf(nurseStationPerson.getNurseStationId()));
|
||||
nurseStationPersonSysUser.setNurseStationPersonId(nurseStationPerson.getId());
|
||||
nurseStationPersonSysUser.setUserId(sysUserAndPerson.getUserId());
|
||||
int stationPersonSysUser = nurseStationPersonMapper.updateNurseStationPersonSysUser(nurseStationPersonSysUser);
|
||||
if (stationPersonSysUser <= 0) {
|
||||
throw new ServiceException("修改护理人员用户信息失败,请联系管理员!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除图片地址
|
||||
*
|
||||
* @param pictureUrl 图片地址
|
||||
**/
|
||||
public void deletePictureUrl(String pictureUrl) {
|
||||
if (StringUtils.isBlank(pictureUrl)) {
|
||||
return;
|
||||
}
|
||||
String picture = XinELuConfig.getProfile() + pictureUrl.replaceAll("/profile", "");
|
||||
File checkReportNameFile = new File(picture);
|
||||
if (checkReportNameFile.exists()) {
|
||||
boolean delete = checkReportNameFile.delete();
|
||||
if (BooleanUtils.isFalse(delete)) {
|
||||
throw new ServiceException("图片地址删除失败!");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,27 @@
|
||||
package com.xinelu.manage.vo.nursestationdepartment;
|
||||
|
||||
|
||||
import com.xinelu.manage.domain.nursestationdepartment.NurseStationDepartment;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @Description 护理站科室返回值实体类
|
||||
* @Author ZH
|
||||
* @Date 2022-09-13
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class NurseStationDepartmentVO extends NurseStationDepartment implements Serializable {
|
||||
private static final long serialVersionUID = -7234356947352741145L;
|
||||
/**
|
||||
* 护理站编号
|
||||
*/
|
||||
private String nurseStationCode;
|
||||
/**
|
||||
* 护理站名称
|
||||
*/
|
||||
private String nurseStationName;
|
||||
}
|
||||
@ -0,0 +1,48 @@
|
||||
package com.xinelu.manage.vo.nursestationperson;
|
||||
|
||||
|
||||
import com.xinelu.manage.domain.nursestationperson.NurseStationPerson;
|
||||
import com.xinelu.manage.domain.nursestationpersoncertificate.NurseStationPersonCertificate;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author ljh
|
||||
* @version 1.0
|
||||
* Create by 2023/3/31 15:35
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class NurseStationPersonCertificateVO extends NurseStationPerson implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 9015841253436848638L;
|
||||
/**
|
||||
* 护理员证书资质信息表集合
|
||||
**/
|
||||
@Valid
|
||||
private List<NurseStationPersonCertificate> nurseStationPersonCertificateList;
|
||||
|
||||
/**
|
||||
* 护理站名称
|
||||
**/
|
||||
private String nurseStationName;
|
||||
|
||||
/**
|
||||
* 护理站科室名称
|
||||
**/
|
||||
private String departmentName;
|
||||
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
private Long id;
|
||||
}
|
||||
@ -0,0 +1,93 @@
|
||||
package com.xinelu.manage.vo.nursestationperson;
|
||||
|
||||
|
||||
import com.xinelu.common.core.domain.BaseDomain;
|
||||
import com.xinelu.common.custominterface.Insert;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import net.sf.jsqlparser.statement.update.Update;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author ljh
|
||||
* @version 1.0
|
||||
* Create by 2022/11/14 15:58
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class NurseStationPersonSysUserVO extends BaseDomain implements Serializable {
|
||||
private static final long serialVersionUID = -6061149045639153952L;
|
||||
/**
|
||||
* 用户账号
|
||||
*/
|
||||
private Long userId;
|
||||
/**
|
||||
* 用户账号 用户昵称
|
||||
*/
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 用户姓名
|
||||
*/
|
||||
@NotBlank(message = "用户姓名不能为空!", groups = {Insert.class, Update.class})
|
||||
private String nickName;
|
||||
|
||||
/**
|
||||
* 手机号码
|
||||
*/
|
||||
@Length(max = 11, message = "手机号码不能超过11位", groups = {Insert.class, Update.class})
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 手机号码
|
||||
*/
|
||||
@Length(max = 11, message = "手机号码不能超过11位", groups = {Insert.class, Update.class})
|
||||
@NotBlank(message = "手机号码不能为空!", groups = {Insert.class, Update.class})
|
||||
private String phonenumber;
|
||||
/**
|
||||
* 登录密码
|
||||
*/
|
||||
@Length(min = 6, max = 10, message = "密码不能低于6位并不能超过10位", groups = {Insert.class})
|
||||
@NotBlank(message = "密码不能为空!", groups = {Insert.class, Update.class})
|
||||
private String stationPersonPassword;
|
||||
|
||||
|
||||
/**
|
||||
* 选择护理站
|
||||
*/
|
||||
@NotBlank(message = "选择护理站不能为空!", groups = {Insert.class, Update.class})
|
||||
private String nurseStationIds;
|
||||
|
||||
/**
|
||||
* 头像地址
|
||||
*/
|
||||
private String avatar;
|
||||
|
||||
/**
|
||||
* 护理站人员表id
|
||||
*/
|
||||
private Long nurseStationPersonId;
|
||||
|
||||
/**
|
||||
* 用户性别(0男 1女 2未知)
|
||||
*/
|
||||
private String sex;
|
||||
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
private String password;
|
||||
|
||||
/**
|
||||
* 帐号状态(0正常 1停用)
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 删除标志(0代表存在 2代表删除)
|
||||
*/
|
||||
private String delFlag;
|
||||
}
|
||||
@ -0,0 +1,63 @@
|
||||
package com.xinelu.manage.vo.nursestationperson;
|
||||
|
||||
import com.xinelu.manage.domain.nursestationperson.NurseStationPerson;
|
||||
import com.xinelu.manage.domain.nursestationpersoncertificate.NurseStationPersonCertificate;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author ljh
|
||||
* @version 1.0
|
||||
* Create by 2022/9/15 9:21
|
||||
*/
|
||||
@Data
|
||||
public class NurseStationPersonVO extends NurseStationPerson implements Serializable {
|
||||
private static final long serialVersionUID = -7039077248335435870L;
|
||||
|
||||
/**
|
||||
* 护理员证书资质信息表集合
|
||||
**/
|
||||
@Valid
|
||||
private List<NurseStationPersonCertificate> nurseStationPersonCertificateList;
|
||||
|
||||
/**
|
||||
* 护理站名称
|
||||
**/
|
||||
private String nurseStationName;
|
||||
|
||||
/**
|
||||
* 护理站科室名称
|
||||
**/
|
||||
private String departmentName;
|
||||
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
NurseStationPersonVO that = (NurseStationPersonVO) o;
|
||||
return Objects.equals(phone, that.phone);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(phone);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,272 @@
|
||||
<?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.xinelu.manage.mapper.nursestationdepartment.NurseStationDepartmentMapper">
|
||||
|
||||
<resultMap type="NurseStationDepartment" id="NurseStationDepartmentResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="nurseStationId" column="nurse_station_id"/>
|
||||
<result property="departmentCode" column="department_code"/>
|
||||
<result property="departmentName" column="department_name"/>
|
||||
<result property="departmentPerson" column="department_person"/>
|
||||
<result property="phone" column="phone"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectNurseStationDepartmentVo">
|
||||
select id,
|
||||
nurse_station_id,
|
||||
department_code,
|
||||
department_name,
|
||||
department_person,
|
||||
phone,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
update_time
|
||||
from nurse_station_department
|
||||
</sql>
|
||||
|
||||
<select id="selectNurseStationDepartmentListtest" parameterType="NurseStationDepartment"
|
||||
resultMap="NurseStationDepartmentResult">
|
||||
<include refid="selectNurseStationDepartmentVo"/>
|
||||
<where>
|
||||
<if test="nurseStationId != null ">
|
||||
and nurse_station_id = #{nurseStationId}
|
||||
</if>
|
||||
<if test="departmentCode != null and departmentCode != ''">
|
||||
and department_code = #{departmentCode}
|
||||
</if>
|
||||
<if test="departmentName != null and departmentName != ''">
|
||||
and department_name like concat('%', #{departmentName}, '%')
|
||||
</if>
|
||||
<if test="departmentPerson != null and departmentPerson != ''">
|
||||
and department_person = #{departmentPerson}
|
||||
</if>
|
||||
<if test="phone != null and phone != ''">
|
||||
and phone = #{phone}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectNurseStationDepartmentByIdTest" parameterType="Long"
|
||||
resultMap="NurseStationDepartmentResult">
|
||||
<include refid="selectNurseStationDepartmentVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertNurseStationDepartment" parameterType="NurseStationDepartment" useGeneratedKeys="true"
|
||||
keyProperty="id">
|
||||
insert into nurse_station_department
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="nurseStationId != null">nurse_station_id,
|
||||
</if>
|
||||
<if test="departmentCode != null">department_code,
|
||||
</if>
|
||||
<if test="departmentName != null">department_name,
|
||||
</if>
|
||||
<if test="departmentPerson != null">department_person,
|
||||
</if>
|
||||
<if test="phone != null">phone,
|
||||
</if>
|
||||
<if test="createBy != null">create_by,
|
||||
</if>
|
||||
<if test="createTime != null">create_time,
|
||||
</if>
|
||||
<if test="updateBy != null">update_by,
|
||||
</if>
|
||||
<if test="updateTime != null">update_time,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="nurseStationId != null">#{nurseStationId},
|
||||
</if>
|
||||
<if test="departmentCode != null">#{departmentCode},
|
||||
</if>
|
||||
<if test="departmentName != null">#{departmentName},
|
||||
</if>
|
||||
<if test="departmentPerson != null">#{departmentPerson},
|
||||
</if>
|
||||
<if test="phone != null">#{phone},
|
||||
</if>
|
||||
<if test="createBy != null">#{createBy},
|
||||
</if>
|
||||
<if test="createTime != null">#{createTime},
|
||||
</if>
|
||||
<if test="updateBy != null">#{updateBy},
|
||||
</if>
|
||||
<if test="updateTime != null">#{updateTime},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateNurseStationDepartment" parameterType="NurseStationDepartment">
|
||||
update nurse_station_department
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="nurseStationId != null">nurse_station_id =
|
||||
#{nurseStationId},
|
||||
</if>
|
||||
<if test="departmentCode != null">department_code =
|
||||
#{departmentCode},
|
||||
</if>
|
||||
<if test="departmentName != null">department_name =
|
||||
#{departmentName},
|
||||
</if>
|
||||
<if test="departmentPerson != null">department_person =
|
||||
#{departmentPerson},
|
||||
</if>
|
||||
<if test="phone != null">phone =
|
||||
#{phone},
|
||||
</if>
|
||||
<if test="createBy != null">create_by =
|
||||
#{createBy},
|
||||
</if>
|
||||
<if test="createTime != null">create_time =
|
||||
#{createTime},
|
||||
</if>
|
||||
<if test="updateBy != null">update_by =
|
||||
#{updateBy},
|
||||
</if>
|
||||
<if test="updateTime != null">update_time =
|
||||
#{updateTime},
|
||||
</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteNurseStationDepartmentById" parameterType="Long">
|
||||
delete
|
||||
from nurse_station_department
|
||||
where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteNurseStationDepartmentByIds" parameterType="String">
|
||||
delete from nurse_station_department where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="selectNurseStationDepartmentList"
|
||||
resultType="com.xinelu.manage.vo.nursestationdepartment.NurseStationDepartmentVO">
|
||||
select
|
||||
nsd.id,
|
||||
nsd.nurse_station_id,
|
||||
nsd.department_code,
|
||||
nsd.department_name,
|
||||
nsd.department_person,
|
||||
nsd.phone,
|
||||
nsd.create_by,
|
||||
nsd.create_time,
|
||||
nsd.update_by,
|
||||
nsd.update_time,
|
||||
ns.nurse_station_name,
|
||||
ns.nurse_station_code
|
||||
from nurse_station_department nsd
|
||||
INNER JOIN nurse_station ns ON ns.id = nsd.nurse_station_id
|
||||
<where>
|
||||
<if test="nurseStationId != null ">
|
||||
and nsd.nurse_station_id = #{nurseStationId}
|
||||
</if>
|
||||
<if test="departmentCode != null and departmentCode != ''">
|
||||
and nsd.department_code = #{departmentCode}
|
||||
</if>
|
||||
<if test="departmentName != null and departmentName != ''">
|
||||
and nsd.department_name like concat('%', #{departmentName}, '%')
|
||||
</if>
|
||||
<if test="departmentPerson != null and departmentPerson != ''">
|
||||
and nsd.department_person = #{departmentPerson}
|
||||
</if>
|
||||
<if test="phone != null and phone != ''">
|
||||
and nsd.phone = #{phone}
|
||||
</if>
|
||||
<if test="createBy != null and createBy != ''">
|
||||
and nsd.create_by = #{createBy}
|
||||
</if>
|
||||
<if test="createTime != null and createTime != ''">
|
||||
and nsd.create_time = #{createTime}
|
||||
</if>
|
||||
<if test="nurseStationName != null and nurseStationName != ''">
|
||||
and ns.nurse_station_name like concat('%', #{nurseStationName},'%')
|
||||
</if>
|
||||
<if test="nurseStationCode != null and nurseStationCode != ''">
|
||||
and nsd.nurse_station_code = #{nurseStationCode}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY nsd.create_time DESC
|
||||
</select>
|
||||
|
||||
<select id="selectNurseStationDepartmentById"
|
||||
resultType="com.xinelu.manage.vo.nursestationdepartment.NurseStationDepartmentVO">
|
||||
select nsd.id,
|
||||
nsd.nurse_station_id,
|
||||
nsd.department_code,
|
||||
nsd.department_name,
|
||||
nsd.department_person,
|
||||
nsd.phone,
|
||||
nsd.create_by,
|
||||
nsd.create_time,
|
||||
nsd.update_by,
|
||||
nsd.update_time,
|
||||
ns.nurse_station_name,
|
||||
ns.nurse_station_code
|
||||
from nurse_station_department nsd
|
||||
INNER JOIN nurse_station ns ON ns.id = nsd.nurse_station_id
|
||||
where nsd.id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertNurseStationDepartmentList" parameterType="java.util.List">
|
||||
insert into nurse_station_department
|
||||
(
|
||||
nurse_station_id,
|
||||
department_code,
|
||||
department_name,
|
||||
department_person,
|
||||
phone,
|
||||
create_by,
|
||||
create_time
|
||||
)
|
||||
VALUE
|
||||
<foreach collection="list" item="item" index="index" separator=",">
|
||||
(
|
||||
#{item.nurseStationId},
|
||||
#{item.departmentCode},
|
||||
#{item.departmentName},
|
||||
#{item.departmentPerson},
|
||||
#{item.phone},
|
||||
#{item.createBy},
|
||||
#{item.createTime}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<select id="getDepartmentName" resultType="int">
|
||||
SELECT
|
||||
count( 1 )
|
||||
FROM
|
||||
nurse_station_department
|
||||
<where>
|
||||
<if test="nurseStationId != null and nurseStationId != ''">
|
||||
and nurse_station_id = #{nurseStationId}
|
||||
</if>
|
||||
<if test="departmentName != null and departmentName != ''">
|
||||
and department_name = #{departmentName}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="getDepartmentPhone" resultType="int">
|
||||
SELECT
|
||||
count( 1 )
|
||||
FROM
|
||||
nurse_station_department
|
||||
where
|
||||
<if test="phone != null and phone != ''">
|
||||
phone = #{phone}
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,209 @@
|
||||
<?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.xinelu.manage.mapper.nursestationpersoncertificate.NurseStationPersonCertificateMapper">
|
||||
|
||||
<resultMap type="NurseStationPersonCertificate" id="NurseStationPersonCertificateResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="nurseStationPersonId" column="nurse_station_person_id"/>
|
||||
<result property="certificateName" column="certificate_name"/>
|
||||
<result property="certificateCode" column="certificate_code"/>
|
||||
<result property="certificateUrl" column="certificate_url"/>
|
||||
<result property="sort" column="sort"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectNurseStationPersonCertificateVo">
|
||||
select id,
|
||||
nurse_station_person_id,
|
||||
certificate_name,
|
||||
certificate_code,
|
||||
certificate_url,
|
||||
sort,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
update_time
|
||||
from nurse_station_person_certificate
|
||||
</sql>
|
||||
|
||||
<select id="selectNurseStationPersonCertificateList" parameterType="NurseStationPersonCertificate"
|
||||
resultMap="NurseStationPersonCertificateResult">
|
||||
<include refid="selectNurseStationPersonCertificateVo"/>
|
||||
<where>
|
||||
<if test="nurseStationPersonId != null ">
|
||||
and nurse_station_person_id = #{nurseStationPersonId}
|
||||
</if>
|
||||
<if test="certificateName != null and certificateName != ''">
|
||||
and certificate_name like concat('%', #{certificateName}, '%')
|
||||
</if>
|
||||
<if test="certificateCode != null and certificateCode != ''">
|
||||
and certificate_code = #{certificateCode}
|
||||
</if>
|
||||
<if test="certificateUrl != null and certificateUrl != ''">
|
||||
and certificate_url = #{certificateUrl}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectNurseStationPersonCertificateById" parameterType="Long"
|
||||
resultMap="NurseStationPersonCertificateResult">
|
||||
<include refid="selectNurseStationPersonCertificateVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertNurseStationPersonCertificate" parameterType="NurseStationPersonCertificate"
|
||||
useGeneratedKeys="true"
|
||||
keyProperty="id">
|
||||
insert into nurse_station_person_certificate
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="nurseStationPersonId != null">nurse_station_person_id,
|
||||
</if>
|
||||
<if test="certificateName != null">certificate_name,
|
||||
</if>
|
||||
<if test="certificateCode != null">certificate_code,
|
||||
</if>
|
||||
<if test="certificateUrl != null">certificate_url,
|
||||
</if>
|
||||
<if test="sort != null">sort,
|
||||
</if>
|
||||
<if test="createBy != null">create_by,
|
||||
</if>
|
||||
<if test="createTime != null">create_time,
|
||||
</if>
|
||||
<if test="updateBy != null">update_by,
|
||||
</if>
|
||||
<if test="updateTime != null">update_time,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="nurseStationPersonId != null">#{nurseStationPersonId},
|
||||
</if>
|
||||
<if test="certificateName != null">#{certificateName},
|
||||
</if>
|
||||
<if test="certificateCode != null">#{certificateCode},
|
||||
</if>
|
||||
<if test="certificateUrl != null">#{certificateUrl},
|
||||
</if>
|
||||
<if test="sort != null">#{sort},
|
||||
</if>
|
||||
<if test="createBy != null">#{createBy},
|
||||
</if>
|
||||
<if test="createTime != null">#{createTime},
|
||||
</if>
|
||||
<if test="updateBy != null">#{updateBy},
|
||||
</if>
|
||||
<if test="updateTime != null">#{updateTime},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateNurseStationPersonCertificate" parameterType="NurseStationPersonCertificate">
|
||||
update nurse_station_person_certificate
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="nurseStationPersonId != null">nurse_station_person_id =
|
||||
#{nurseStationPersonId},
|
||||
</if>
|
||||
<if test="certificateName != null">certificate_name =
|
||||
#{certificateName},
|
||||
</if>
|
||||
<if test="certificateCode != null">certificate_code =
|
||||
#{certificateCode},
|
||||
</if>
|
||||
<if test="certificateUrl != null">certificate_url =
|
||||
#{certificateUrl},
|
||||
</if>
|
||||
<if test="sort != null">sort =
|
||||
#{sort},
|
||||
</if>
|
||||
<if test="createBy != null">create_by =
|
||||
#{createBy},
|
||||
</if>
|
||||
<if test="createTime != null">create_time =
|
||||
#{createTime},
|
||||
</if>
|
||||
<if test="updateBy != null">update_by =
|
||||
#{updateBy},
|
||||
</if>
|
||||
<if test="updateTime != null">update_time =
|
||||
#{updateTime},
|
||||
</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteNurseStationPersonCertificateById" parameterType="Long">
|
||||
delete
|
||||
from nurse_station_person_certificate
|
||||
where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteNurseStationPersonCertificateByIds" parameterType="String">
|
||||
delete from nurse_station_person_certificate where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<insert id="insertNurseStationPersonCertificateList" parameterType="java.util.List">
|
||||
insert into nurse_station_person_certificate(
|
||||
nurse_station_person_id,
|
||||
certificate_name,
|
||||
certificate_code,
|
||||
certificate_url,
|
||||
sort,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
update_time
|
||||
) values
|
||||
<foreach item="NurseStationPersonCertificate" index="index" collection="list" separator=",">
|
||||
(
|
||||
#{NurseStationPersonCertificate.nurseStationPersonId},
|
||||
#{NurseStationPersonCertificate.certificateName},
|
||||
#{NurseStationPersonCertificate.certificateCode},
|
||||
#{NurseStationPersonCertificate.certificateUrl},
|
||||
#{NurseStationPersonCertificate.sort},
|
||||
#{NurseStationPersonCertificate.createBy},
|
||||
#{NurseStationPersonCertificate.createTime},
|
||||
#{NurseStationPersonCertificate.updateBy},
|
||||
#{NurseStationPersonCertificate.updateTime}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<select id="selectNurseStationPersonCertificateByIds" parameterType="Long"
|
||||
resultType="NurseStationPersonCertificate">
|
||||
select id,
|
||||
nurse_station_person_id,
|
||||
certificate_name,
|
||||
certificate_code,
|
||||
certificate_url,
|
||||
sort,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
update_time
|
||||
from nurse_station_person_certificate
|
||||
<where>
|
||||
<if test="nurseStationPersonIdsList != null and nurseStationPersonIdsList.size() > 0 ">
|
||||
and nurse_station_person_id in
|
||||
<foreach item="nurseStationPersonIds" collection="nurseStationPersonIdsList" open="(" separator=","
|
||||
close=")">
|
||||
#{nurseStationPersonIds}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<delete id="deleteNurseStationPersonCertificateByPersonIds">
|
||||
delete from nurse_station_person_certificate where nurse_station_person_id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@ -17,7 +17,7 @@ public interface SysUserRoleMapper {
|
||||
* @param userId 用户ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteUserRoleByUserId(Long userId);
|
||||
int deleteUserRoleByUserId(Long userId);
|
||||
|
||||
/**
|
||||
* 批量删除用户和角色关联
|
||||
@ -25,7 +25,7 @@ public interface SysUserRoleMapper {
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteUserRole(Long[] ids);
|
||||
int deleteUserRole(Long[] ids);
|
||||
|
||||
/**
|
||||
* 通过角色ID查询角色使用数量
|
||||
@ -33,7 +33,7 @@ public interface SysUserRoleMapper {
|
||||
* @param roleId 角色ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int countUserRoleByRoleId(Long roleId);
|
||||
int countUserRoleByRoleId(Long roleId);
|
||||
|
||||
/**
|
||||
* 批量新增用户角色信息
|
||||
@ -41,7 +41,7 @@ public interface SysUserRoleMapper {
|
||||
* @param userRoleList 用户角色列表
|
||||
* @return 结果
|
||||
*/
|
||||
public int batchUserRole(List<SysUserRole> userRoleList);
|
||||
int batchUserRole(List<SysUserRole> userRoleList);
|
||||
|
||||
/**
|
||||
* 删除用户和角色关联信息
|
||||
@ -49,7 +49,7 @@ public interface SysUserRoleMapper {
|
||||
* @param userRole 用户和角色关联信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteUserRoleInfo(SysUserRole userRole);
|
||||
int deleteUserRoleInfo(SysUserRole userRole);
|
||||
|
||||
/**
|
||||
* 批量取消授权用户角色
|
||||
@ -58,5 +58,13 @@ public interface SysUserRoleMapper {
|
||||
* @param userIds 需要删除的用户数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteUserRoleInfos(@Param("roleId") Long roleId, @Param("userIds") Long[] userIds);
|
||||
}
|
||||
int deleteUserRoleInfos(@Param("roleId") Long roleId, @Param("userIds") Long[] userIds);
|
||||
|
||||
/**
|
||||
* 新增用户角色信息
|
||||
*
|
||||
* @param sysUserRole 用户角色信息
|
||||
* @return int
|
||||
**/
|
||||
int insertSysUserRole(SysUserRole sysUserRole);
|
||||
}
|
||||
@ -41,4 +41,22 @@
|
||||
#{userId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<insert id="insertSysUserRole"
|
||||
parameterType="SysUserRole"
|
||||
useGeneratedKeys="true" keyProperty="userId">
|
||||
insert into sys_user_role
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="userId != null ">user_id,
|
||||
</if>
|
||||
<if test="roleId != null ">role_id,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="userId != null ">#{userId},
|
||||
</if>
|
||||
<if test="roleId != null ">#{roleId},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue
Block a user