Browse Source

职务职称变更记录接口

zhanghang 3 years ago
parent
commit
67b68da179

+ 46 - 0
daqe-center/src/main/java/com/lantone/daqe/dto/GetOfficialCapacityPageDTO.java

@@ -0,0 +1,46 @@
+package com.lantone.daqe.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @Description: 获取职务职称变更记录-接口出参
+ * @author: zhanghang
+ * @time: 2022/2/28
+ */
+@ApiModel(value = "获取职务职称变更记录-接口出参")
+@Getter
+@Setter
+public class GetOfficialCapacityPageDTO implements Serializable {
+
+
+    private static final long serialVersionUID = -5020172914749530114L;
+    @ApiModelProperty(value = "组织机构ID")
+    private Long hospitalId;
+
+    @ApiModelProperty(value = "职务/职称名称")
+    private String name;
+
+    @ApiModelProperty(value = "类型:1-职务;2-职称")
+    private String type;
+
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "职位/职称变更时间")
+    private Date changeTime;
+
+    @ApiModelProperty(value = "医生姓名")
+    private String doctorName;
+
+    @ApiModelProperty(value = "工号")
+    private String doctorCode;
+
+    @ApiModelProperty(value = "科室名称")
+    private String deptName;
+
+}

+ 1 - 1
daqe-center/src/main/java/com/lantone/daqe/dto/GetRecordTemplatePageDTO.java

@@ -21,7 +21,7 @@ public class GetRecordTemplatePageDTO implements Serializable {
     private static final long serialVersionUID = 8095973115574155886L;
     @ApiModelProperty(value = "主键")
     private Long Id;
-    
+
     @ApiModelProperty(value = "组织机构ID")
     private Long hospitalId;
 

+ 75 - 0
daqe-center/src/main/java/com/lantone/daqe/facade/OfficialCapacityManagementFacade.java

@@ -0,0 +1,75 @@
+package com.lantone.daqe.facade;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.lantone.common.enums.IsDeleteEnum;
+import com.lantone.common.util.BeanUtil;
+import com.lantone.common.util.StringUtil;
+import com.lantone.daqe.dto.GetOfficialCapacityPageDTO;
+import com.lantone.daqe.entity.OfficialCapacity;
+import com.lantone.daqe.facade.base.OfficialCapacityFacade;
+import com.lantone.daqe.vo.DelOfficialCapacityByIdVO;
+import com.lantone.daqe.vo.GetOfficialCapacityPageVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @Description: 职务职称变更记录-业务处理类
+ * @author: zhanghang
+ * @time: 2022/2/28
+ */
+
+@Component
+public class OfficialCapacityManagementFacade {
+
+    @Autowired
+    private OfficialCapacityFacade officialCapacityFacade;
+
+
+    public IPage<GetOfficialCapacityPageDTO> getOfficialCapacityPage(GetOfficialCapacityPageVO getOfficialCapacityPageVO) {
+        Page<GetOfficialCapacityPageDTO> getOfficialCapacityPageDTOPage = new Page<>();
+
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        String startDate = null;
+        String endDate = null;
+        if (getOfficialCapacityPageVO.getChangeTimeStart() != null) {
+            startDate = sdf.format(getOfficialCapacityPageVO.getChangeTimeStart());
+        }
+        if (getOfficialCapacityPageVO.getChangeTimeEnd() != null) {
+            endDate = sdf.format(getOfficialCapacityPageVO.getChangeTimeStart());
+        }
+        QueryWrapper<OfficialCapacity> officialCapacityQueryWrapper = new QueryWrapper<>();
+        officialCapacityQueryWrapper.eq(getOfficialCapacityPageVO.getHospitalId() != null, "hospital_id", getOfficialCapacityPageVO.getHospitalId());
+        officialCapacityQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey());
+        officialCapacityQueryWrapper.ge(StringUtil.isNotBlank(startDate), "change_time", getOfficialCapacityPageVO.getChangeTimeStart());
+        officialCapacityQueryWrapper.le(StringUtil.isNotBlank(endDate), "change_time", getOfficialCapacityPageVO.getChangeTimeEnd());
+        officialCapacityQueryWrapper.like(StringUtil.isNotBlank(getOfficialCapacityPageVO.getType()), "type", getOfficialCapacityPageVO.getType());
+        officialCapacityQueryWrapper.like(StringUtil.isNotBlank(getOfficialCapacityPageVO.getName()), "name", getOfficialCapacityPageVO.getName());
+        officialCapacityQueryWrapper.like(StringUtil.isNotBlank(getOfficialCapacityPageVO.getDoctorName()), "doctor_name", getOfficialCapacityPageVO.getDoctorName());
+        officialCapacityQueryWrapper.like(StringUtil.isNotBlank(getOfficialCapacityPageVO.getDoctorCode()), "doctor_code", getOfficialCapacityPageVO.getDoctorCode());
+        officialCapacityQueryWrapper.like(StringUtil.isNotBlank(getOfficialCapacityPageVO.getDeptName()), "dept_name", getOfficialCapacityPageVO.getDeptName());
+        Page<OfficialCapacity> officialCapacityPage = new Page<>(getOfficialCapacityPageVO.getCurrent(), getOfficialCapacityPageVO.getSize());
+        officialCapacityFacade.page(officialCapacityPage, officialCapacityQueryWrapper);
+        BeanUtil.copyProperties(officialCapacityPage, getOfficialCapacityPageDTOPage);
+        List<GetOfficialCapacityPageDTO> getOfficialCapacityPageDTOList = BeanUtil.listCopyTo(officialCapacityPage.getRecords(), GetOfficialCapacityPageDTO.class);
+
+        getOfficialCapacityPageDTOPage.setRecords(getOfficialCapacityPageDTOList);
+        return getOfficialCapacityPageDTOPage;
+    }
+
+    public Boolean delOfficialCapacityPage(DelOfficialCapacityByIdVO delOfficialCapacityByIdVO) {
+        OfficialCapacity officialCapacity = new OfficialCapacity();
+        officialCapacity.setIsDeleted(IsDeleteEnum.Y.getKey());
+        officialCapacity.setGmtModified(new Date());
+        return officialCapacityFacade.update(officialCapacity, new QueryWrapper<OfficialCapacity>()
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("id", delOfficialCapacityByIdVO.getId())
+        );
+    }
+
+}

+ 5 - 5
daqe-center/src/main/java/com/lantone/daqe/facade/RecordTemplateManagementFacade.java

@@ -1,7 +1,6 @@
 package com.lantone.daqe.facade;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.lantone.common.enums.IsDeleteEnum;
@@ -18,10 +17,11 @@ import org.springframework.stereotype.Component;
 import java.util.List;
 
 /**
- * @Description: 手术管理-业务处理类
- * @author: rengb
- * @time: 2021/7/20 12:39
+ * @Description: 文书模板维护-业务处理类
+ * @author: zhanghang
+ * @time: 2022/2/28
  */
+
 @Component
 public class RecordTemplateManagementFacade {
 
@@ -33,7 +33,7 @@ public class RecordTemplateManagementFacade {
 
         QueryWrapper<RecordTemplate> recordTemplateQueryWrapper = new QueryWrapper<>();
         recordTemplateQueryWrapper.eq(getRecordTemplatePageVO.getHospitalId() != null, "hospital_id", getRecordTemplatePageVO.getHospitalId());
-        recordTemplateQueryWrapper.eq( "is_deleted", IsDeleteEnum.N.getKey());
+        recordTemplateQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey());
         recordTemplateQueryWrapper.like(StringUtil.isNotBlank(getRecordTemplatePageVO.getCode()), "code", getRecordTemplatePageVO.getCode());
         recordTemplateQueryWrapper.like(StringUtil.isNotBlank(getRecordTemplatePageVO.getName()), "name", getRecordTemplatePageVO.getName());
         recordTemplateQueryWrapper.like(StringUtil.isNotBlank(getRecordTemplatePageVO.getParentCode()), "parent_code", getRecordTemplatePageVO.getParentCode());

+ 27 - 0
daqe-center/src/main/java/com/lantone/daqe/vo/DelOfficialCapacityByIdVO.java

@@ -0,0 +1,27 @@
+package com.lantone.daqe.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.validation.constraints.NotNull;
+import java.io.Serializable;
+
+/**
+ * @Description: 删除职务职称变更记录-接口入参
+ * @author: zhanghang
+ * @time: 2022/2/28
+ */
+@ApiModel(value = "删除职务职称变更记录-接口入参")
+@Getter
+@Setter
+public class DelOfficialCapacityByIdVO implements Serializable {
+
+    private static final long serialVersionUID = 730596041870962141L;
+
+    @ApiModelProperty(value = "记录ID", required = true)
+    @NotNull(message = "记录ID不能为空")
+    private Long id;
+
+}

+ 8 - 4
daqe-center/src/main/java/com/lantone/daqe/vo/GetOfficialCapacityPageVO.java

@@ -10,11 +10,11 @@ import org.springframework.format.annotation.DateTimeFormat;
 import java.util.Date;
 
 /**
- * @Description: 获取文书模块分页列表-接口入参
+ * @Description: 获取职务职称变更记录-接口入参
  * @author: zhanghang
  * @time: 2022/2/28
  */
-@ApiModel(value = "获取文书模块分页列表-接口入参")
+@ApiModel(value = "获取职务职称变更记录-接口入参")
 @Getter
 @Setter
 public class GetOfficialCapacityPageVO extends Page {
@@ -31,8 +31,12 @@ public class GetOfficialCapacityPageVO extends Page {
     private String type;
 
     @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    @ApiModelProperty(value = "职位/职称变更时间")
-    private Date changeTime;
+    @ApiModelProperty(value = "职位/职称变更开始时间")
+    private Date changeTimeStart;
+
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "职位/职称变更结束时间")
+    private Date changeTimeEnd;
 
     @ApiModelProperty(value = "医生姓名")
     private String doctorName;

+ 44 - 0
daqe-center/src/main/java/com/lantone/daqe/web/OfficialCapacityManagementController.java

@@ -0,0 +1,44 @@
+package com.lantone.daqe.web;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.lantone.common.api.CommonResult;
+import com.lantone.daqe.dto.GetOfficialCapacityPageDTO;
+import com.lantone.daqe.facade.OfficialCapacityManagementFacade;
+import com.lantone.daqe.vo.DelOfficialCapacityByIdVO;
+import com.lantone.daqe.vo.GetOfficialCapacityPageVO;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+
+/**
+ * @Description: 职务职称信息变更记录API
+ * @author: zhanghang
+ * @time: 2022/2/28
+ */
+
+@RestController
+@Api(value = "职务职称变更记录API", tags = {"职务职称变更记录API"})
+@RequestMapping("/officialCapacityManage")
+public class OfficialCapacityManagementController {
+
+    @Autowired
+    private OfficialCapacityManagementFacade officialCapacityManagementFacade;
+
+    @ApiOperation(value = "获取职务职称变更记录 [by:zhanghang]")
+    @PostMapping("/getOfficialCapacityPage")
+    public CommonResult<IPage<GetOfficialCapacityPageDTO>> getOfficialCapacityPage(@RequestBody GetOfficialCapacityPageVO getOfficialCapacityPageVO) {
+        return CommonResult.success(officialCapacityManagementFacade.getOfficialCapacityPage(getOfficialCapacityPageVO));
+    }
+
+    @ApiOperation(value = "删除职务职称变更记录 [by:zhanghang]")
+    @PostMapping("/delOfficialCapacityPage")
+    public CommonResult<Boolean> delOfficialCapacityPage(@RequestBody DelOfficialCapacityByIdVO delOfficialCapacityByIdVO) {
+        return CommonResult.success(officialCapacityManagementFacade.delOfficialCapacityPage(delOfficialCapacityByIdVO));
+    }
+
+}

+ 4 - 9
daqe-center/src/main/java/com/lantone/daqe/web/RecordTemplateManagementController.java

@@ -2,12 +2,9 @@ package com.lantone.daqe.web;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.lantone.common.api.CommonResult;
-import com.lantone.daqe.dto.GetOperationPageDTO;
 import com.lantone.daqe.dto.GetRecordTemplatePageDTO;
 import com.lantone.daqe.entity.RecordTemplate;
-import com.lantone.daqe.facade.OperationManagementFacade;
 import com.lantone.daqe.facade.RecordTemplateManagementFacade;
-import com.lantone.daqe.vo.GetOperationPageVO;
 import com.lantone.daqe.vo.GetRecordTemplateByIdVO;
 import com.lantone.daqe.vo.GetRecordTemplatePageVO;
 import io.swagger.annotations.Api;
@@ -20,15 +17,13 @@ import org.springframework.web.bind.annotation.RestController;
 
 
 /**
- * <p>
- *   文书模板维护API
- * </p>
- * @author zhanghang
- * @since 2022/2/28
+ * @Description: 文书模板维护API
+ * @author: zhanghang
+ * @time: 2022/2/28
  */
 
 @RestController
-@Api(value = "文书模板维护API", tags = { "文书模板维护API" })
+@Api(value = "文书模板维护API", tags = {"文书模板维护API"})
 @RequestMapping("/recordTemplateManage")
 public class RecordTemplateManagementController {