Prechádzať zdrojové kódy

Merge remote-tracking branch 'origin/dev/icss' into dev/icss

wangyu 6 rokov pred
rodič
commit
7318e3bd78

+ 36 - 0
icss-service/src/main/java/com/diagbot/dto/DoctorPageModeDTO.java

@@ -0,0 +1,36 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 
+ * @author wangfeng
+ * @Description: TODO
+ * @date 2018年12月18日 下午1:48:52
+ */
+@Getter
+@Setter
+public class DoctorPageModeDTO {
+
+	    private Long id;
+	    /**
+	     * 医生id
+	     */
+	    private Long doctorId;
+
+	    /**
+	     * 模式分类
+	     */
+	    private Integer modeClassify;
+
+	    /**
+	     * 模式值
+	     */
+	    private Integer modeValue;
+
+	    /**
+	     * 备注
+	     */
+	    private String remark;
+}

+ 18 - 10
icss-service/src/main/java/com/diagbot/facade/DoctorPageModeFacade.java

@@ -1,19 +1,25 @@
 package com.diagbot.facade;
 
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.validation.Valid;
+
+import org.springframework.stereotype.Component;
+import org.springframework.transaction.annotation.Transactional;
+
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
+import com.diagbot.dto.DoctorPageModeDTO;
+import com.diagbot.dto.TemplateInfoDTO;
 import com.diagbot.entity.DoctorPageMode;
 import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.service.impl.DoctorPageModeServiceImpl;
+import com.diagbot.util.BeanUtil;
 import com.diagbot.util.DateUtil;
 import com.diagbot.vo.DoctorIdVO;
 import com.diagbot.vo.DoctorPageModeVO;
-import org.springframework.stereotype.Component;
-import org.springframework.transaction.annotation.Transactional;
-
-import javax.validation.Valid;
-import java.util.HashMap;
-import java.util.Map;
 
 /**
  * @author wangfeng
@@ -34,13 +40,14 @@ public class DoctorPageModeFacade extends DoctorPageModeServiceImpl {
         QueryWrapper<DoctorPageMode> doctorPageModeWrapper = new QueryWrapper<>();
         Map<String, Object> mapAll = new HashMap<>();
         mapAll.put("doctor_id", doctorPageModeVO.getDoctorId());
+        mapAll.put("mode_classify", doctorPageModeVO.getModeClassify());
         mapAll.put("is_deleted", IsDeleteEnum.N.getKey());
         doctorPageModeWrapper.allEq(mapAll);
         DoctorPageMode datas = getOne(doctorPageModeWrapper);
         boolean res = false;
         if (datas != null) {
             UpdateWrapper<DoctorPageMode> doctorPageModeUpdate = new UpdateWrapper<>();
-            doctorPageModeUpdate.allEq(mapAll)
+            doctorPageModeUpdate.eq("id",datas.getId())
                     .set("mode_classify", doctorPageModeVO.getModeClassify())
                     .set("mode_value", doctorPageModeVO.getModeValue())
                     .set("modifier", doctorPageModeVO.getDoctorId().toString())
@@ -66,14 +73,15 @@ public class DoctorPageModeFacade extends DoctorPageModeServiceImpl {
      * @param doctorIdVO
      * @return
      */
-    public DoctorPageMode getDoctorPageMode(@Valid DoctorIdVO doctorIdVO) {
+    public List<DoctorPageModeDTO> getDoctorPageMode(@Valid DoctorIdVO doctorIdVO) {
         QueryWrapper<DoctorPageMode> doctorPageModeWrapper = new QueryWrapper<>();
         Map<String, Object> mapAll = new HashMap<>();
         mapAll.put("doctor_id", doctorIdVO.getDoctorId());
         mapAll.put("is_deleted", IsDeleteEnum.N.getKey());
         doctorPageModeWrapper.allEq(mapAll);
-        DoctorPageMode doctorPageModeData = getOne(doctorPageModeWrapper);
-        return doctorPageModeData;
+        List<DoctorPageMode> doctorPageModeData = list(doctorPageModeWrapper);
+        List<DoctorPageModeDTO> data =  BeanUtil.listCopyTo(doctorPageModeData, DoctorPageModeDTO.class);
+        return data;
     }
 
 }

+ 15 - 11
icss-service/src/main/java/com/diagbot/web/DoctorPageModeController.java

@@ -1,14 +1,10 @@
 package com.diagbot.web;
 
 
-import com.diagbot.annotation.SysLogger;
-import com.diagbot.dto.RespDTO;
-import com.diagbot.entity.DoctorPageMode;
-import com.diagbot.facade.DoctorPageModeFacade;
-import com.diagbot.vo.DoctorIdVO;
-import com.diagbot.vo.DoctorPageModeVO;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
+import java.util.List;
+
+import javax.validation.Valid;
+
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.PostMapping;
@@ -16,7 +12,15 @@ 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;
+import com.diagbot.annotation.SysLogger;
+import com.diagbot.dto.DoctorPageModeDTO;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.facade.DoctorPageModeFacade;
+import com.diagbot.vo.DoctorIdVO;
+import com.diagbot.vo.DoctorPageModeVO;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
 
 /**
  * <p>
@@ -56,9 +60,9 @@ public class DoctorPageModeController {
     @ApiOperation(value = "获取医生页面结构设置信息[by:wangfeng]", notes = "获取医生页面结构设置信息")
     @PostMapping("/getDoctorPageModes")
     @SysLogger("getDoctorPageModes")
-    public RespDTO<DoctorPageMode> getDoctorPageModes(@Valid @RequestBody DoctorIdVO doctorIdVO) {
+    public RespDTO<List<DoctorPageModeDTO>> getDoctorPageModes(@Valid @RequestBody DoctorIdVO doctorIdVO) {
 
-        DoctorPageMode doctorPageModeData = doctorPageModeFacade.getDoctorPageMode(doctorIdVO);
+    	List<DoctorPageModeDTO> doctorPageModeData = doctorPageModeFacade.getDoctorPageMode(doctorIdVO);
 
         return RespDTO.onSuc(doctorPageModeData);
     }