Pārlūkot izejas kodu

常用标签维护——详情

wangyu 6 gadi atpakaļ
vecāks
revīzija
82d3968e23

+ 12 - 2
icssman-service/src/main/java/com/diagbot/facade/DeptInfoFacade.java

@@ -9,6 +9,7 @@ import com.diagbot.util.BeanUtil;
 import com.diagbot.util.DateUtil;
 import com.diagbot.util.UserUtils;
 import com.diagbot.vo.AddDeptInfoVO;
+import com.diagbot.vo.GetDeptInfoDetialsVO;
 import com.diagbot.vo.GetDeptInfoVO;
 import com.diagbot.vo.UpdateDeptInfoVO;
 import org.springframework.stereotype.Component;
@@ -37,7 +38,6 @@ public class DeptInfoFacade extends DeptInfoServiceImpl {
         deptInfo.setCreator(userId);
         deptInfo.setGmtCreate(now);
         deptInfo.setModifier(userId);
-        deptInfo.setGmtModified(now);
         this.save(deptInfo);
         return true;
     }
@@ -48,7 +48,7 @@ public class DeptInfoFacade extends DeptInfoServiceImpl {
      * @return
      */
     public Boolean updateDeptInfo(UpdateDeptInfoVO updateDeptInfoVO) {
-        DeptInfo deptInfo =new DeptInfo();
+        DeptInfo deptInfo =this.getById(updateDeptInfoVO.getId());
         BeanUtil.copyProperties(updateDeptInfoVO,deptInfo);
         deptInfo.setModifier(UserUtils.getCurrentPrincipleID());
         deptInfo.setGmtModified(DateUtil.now());
@@ -90,4 +90,14 @@ public class DeptInfoFacade extends DeptInfoServiceImpl {
         List<DeptInfoDTO> deptInfoList = this.getDeptName();
         return deptInfoList;
     }
+
+    /**
+     * 科室维护详情
+     * @param getDeptInfoDetialsVO
+     * @return
+     */
+    public DeptInfo getDeptInfoDetials(GetDeptInfoDetialsVO getDeptInfoDetialsVO){
+        DeptInfo deptInfo = this.getById(getDeptInfoDetialsVO.getId());
+        return deptInfo;
+    }
 }

+ 6 - 0
icssman-service/src/main/java/com/diagbot/vo/AddDeptInfoVO.java

@@ -15,4 +15,10 @@ import javax.validation.constraints.NotNull;
 public class AddDeptInfoVO {
     @NotNull(message = "请输入科室名称")
     private String name;
+
+    /**
+     * 备注,介绍说明
+     */
+    private String remark;
+
 }

+ 18 - 0
icssman-service/src/main/java/com/diagbot/vo/GetDeptInfoDetialsVO.java

@@ -0,0 +1,18 @@
+package com.diagbot.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.validation.constraints.NotNull;
+
+/**
+ * @Description:
+ * @author: wangyu
+ * @time: 2018/12/14 9:57
+ */
+@Getter
+@Setter
+public class GetDeptInfoDetialsVO {
+    @NotNull(message = "请输入科室id")
+    private Long id;
+}

+ 16 - 5
icssman-service/src/main/java/com/diagbot/web/DeptInfoController.java

@@ -7,6 +7,7 @@ import com.diagbot.dto.RespDTO;
 import com.diagbot.entity.DeptInfo;
 import com.diagbot.facade.DeptInfoFacade;
 import com.diagbot.vo.AddDeptInfoVO;
+import com.diagbot.vo.GetDeptInfoDetialsVO;
 import com.diagbot.vo.GetDeptInfoVO;
 import com.diagbot.vo.UpdateDeptInfoVO;
 import io.swagger.annotations.Api;
@@ -18,6 +19,8 @@ import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import javax.validation.Valid;
+
 /**
  * <p>
  * 科室信息表 前端控制器
@@ -40,7 +43,7 @@ public class DeptInfoController {
     @PostMapping("/addDeptInfo")
     @SysLogger("addDeptInfo")
     @Transactional
-    public RespDTO<Boolean> addDeptInfo(@RequestBody AddDeptInfoVO addDeptInfoVO) {
+    public RespDTO<Boolean> addDeptInfo(@Valid @RequestBody AddDeptInfoVO addDeptInfoVO) {
         Boolean data = deptInfoFacade.addDeptInfo(addDeptInfoVO);
         return RespDTO.onSuc(data);
     }
@@ -51,7 +54,7 @@ public class DeptInfoController {
     @PostMapping("/updateDeptInfo")
     @SysLogger("updateDeptInfo")
     @Transactional
-    public RespDTO<Boolean> updateDeptInfo(@RequestBody UpdateDeptInfoVO updateDeptInfoVO) {
+    public RespDTO<Boolean> updateDeptInfo(@Valid @RequestBody UpdateDeptInfoVO updateDeptInfoVO) {
         Boolean data = deptInfoFacade.updateDeptInfo(updateDeptInfoVO);
         return RespDTO.onSuc(data);
     }
@@ -61,7 +64,7 @@ public class DeptInfoController {
     @PostMapping("/deleteDeptInfo")
     @SysLogger("deleteDeptInfo")
     @Transactional
-    public RespDTO<Boolean> deleteDeptInfo(@RequestBody UpdateDeptInfoVO updateDeptInfoVO) {
+    public RespDTO<Boolean> deleteDeptInfo(@Valid@RequestBody UpdateDeptInfoVO updateDeptInfoVO) {
         Boolean data = deptInfoFacade.deleteDeptInfo(updateDeptInfoVO);
         return RespDTO.onSuc(data);
     }
@@ -70,9 +73,17 @@ public class DeptInfoController {
             notes = "name: 科室名称 <br>")
     @PostMapping("/getDeptInfo")
     @SysLogger("getDeptInfo")
-    @Transactional
-    public RespDTO<IPage<DeptInfo>> getDeptInfo(@RequestBody GetDeptInfoVO getDeptInfoVO) {
+    public RespDTO<IPage<DeptInfo>> getDeptInfo(@Valid @RequestBody GetDeptInfoVO getDeptInfoVO) {
         IPage<DeptInfo> data = deptInfoFacade.getDeptInfo(getDeptInfoVO);
         return RespDTO.onSuc(data);
     }
+
+    @ApiOperation(value = "科室维护——详情[by:wangyu]",
+            notes = "deptId: 科室id <br>")
+    @PostMapping("/getDeptInfoDetials")
+    @SysLogger("getDeptInfoDetials")
+    public RespDTO<DeptInfo> getDeptInfoDetials(@Valid @RequestBody GetDeptInfoDetialsVO getDeptInfoDetialsVO) {
+        DeptInfo data = deptInfoFacade.getDeptInfoDetials(getDeptInfoDetialsVO);
+        return RespDTO.onSuc(data);
+    }
 }