Browse Source

Merge branch 'dev/icss' into debug

gaodm 6 năm trước cách đây
mục cha
commit
8d9a5693cc
33 tập tin đã thay đổi với 363 bổ sung360 xóa
  1. 1 1
      icss-service/src/main/java/com/diagbot/entity/IntroduceDetail.java
  2. 3 2
      icss-service/src/main/java/com/diagbot/enums/IntroducePositionEnum.java
  3. 5 6
      icss-service/src/main/java/com/diagbot/facade/PatientInfoFacade.java
  4. 0 14
      icss-service/src/main/java/com/diagbot/facade/QuestionFacade.java
  5. 1 1
      icss-service/src/main/java/com/diagbot/vo/PatientInfoVO.java
  6. 0 13
      icss-service/src/main/java/com/diagbot/web/QuestionInfoController.java
  7. 0 26
      icssman-service/src/main/java/com/diagbot/client/IcssServiceClient.java
  8. 5 3
      icssman-service/src/main/java/com/diagbot/client/UserServiceClient.java
  9. 0 33
      icssman-service/src/main/java/com/diagbot/client/hystrix/IcssServiceHystrix.java
  10. 9 5
      icssman-service/src/main/java/com/diagbot/client/hystrix/UserServiceHystrix.java
  11. 1 1
      icssman-service/src/main/java/com/diagbot/entity/IntroduceDetail.java
  12. 0 142
      icssman-service/src/main/java/com/diagbot/entity/User.java
  13. 3 2
      icssman-service/src/main/java/com/diagbot/enums/IntroducePositionEnum.java
  14. 8 2
      icssman-service/src/main/java/com/diagbot/facade/DeptInfoFacade.java
  15. 30 13
      icssman-service/src/main/java/com/diagbot/facade/DeptVitalFacade.java
  16. 39 1
      icssman-service/src/main/java/com/diagbot/facade/IntroduceDetailFacade.java
  17. 65 28
      icssman-service/src/main/java/com/diagbot/facade/IntroduceInfoFacade.java
  18. 13 8
      icssman-service/src/main/java/com/diagbot/facade/IntroduceMapFacade.java
  19. 14 0
      icssman-service/src/main/java/com/diagbot/facade/QuestionInfoFacade.java
  20. 21 9
      icssman-service/src/main/java/com/diagbot/facade/QuestionUsualFacade.java
  21. 25 13
      icssman-service/src/main/java/com/diagbot/facade/VitalOrderFacade.java
  22. 13 1
      icssman-service/src/main/java/com/diagbot/mapper/DeptInfoMapper.java
  23. 2 0
      icssman-service/src/main/java/com/diagbot/mapper/QuestionInfoMapper.java
  24. 11 0
      icssman-service/src/main/java/com/diagbot/service/DeptInfoService.java
  25. 8 0
      icssman-service/src/main/java/com/diagbot/service/impl/DeptInfoServiceImpl.java
  26. 2 3
      icssman-service/src/main/java/com/diagbot/web/IntroduceDetailController.java
  27. 16 3
      icssman-service/src/main/java/com/diagbot/web/QuestionUsualController.java
  28. 2 2
      icssman-service/src/main/java/com/diagbot/web/RetrievalController.java
  29. 7 0
      icssman-service/src/main/resources/mapper/DeptInfoMapper.xml
  30. 1 0
      user-service/src/main/java/com/diagbot/config/ResourceServerConfigurer.java
  31. 1 0
      user-service/src/main/java/com/diagbot/config/security/UrlAccessDecisionManager.java
  32. 49 28
      user-service/src/main/java/com/diagbot/facade/UserFacade.java
  33. 8 0
      user-service/src/main/java/com/diagbot/web/UserController.java

+ 1 - 1
icss-service/src/main/java/com/diagbot/entity/IntroduceDetail.java

@@ -76,7 +76,7 @@ public class IntroduceDetail implements Serializable {
     private Integer orderNo;
 
     /**
-     * 显示位置:1-右侧显示,0-都显
+     * 显示位置:0-都展示,1-推送展示,2-更多展
      */
     private Integer position;
 

+ 3 - 2
icss-service/src/main/java/com/diagbot/enums/IntroducePositionEnum.java

@@ -9,8 +9,9 @@ import lombok.Setter;
  * @time: 2018/11/23 10:12
  */
 public enum IntroducePositionEnum implements KeyedNamed {
-    Right(1, "右侧"),
-    All(0, "右侧+全文");
+    All(0, "都展示"),
+    Push(1, "推送展示"),
+    More(2, "更多展示");
 
     @Setter
     private Integer key;

+ 5 - 6
icss-service/src/main/java/com/diagbot/facade/PatientInfoFacade.java

@@ -1,10 +1,5 @@
 package com.diagbot.facade;
 
-import java.util.List;
-
-import org.springframework.stereotype.Component;
-import org.springframework.web.bind.annotation.RequestBody;
-
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.diagbot.dto.GetTopPatientInfoDTO;
 import com.diagbot.dto.PatientInfoDTO;
@@ -15,6 +10,10 @@ import com.diagbot.service.impl.PatientInfoServiceImpl;
 import com.diagbot.util.ListUtil;
 import com.diagbot.vo.GetTopPatientInfoVO;
 import com.diagbot.vo.PatientInfoVO;
+import org.springframework.stereotype.Component;
+import org.springframework.web.bind.annotation.RequestBody;
+
+import java.util.List;
 
 /**
  * @Description: 患者业务逻辑
@@ -30,7 +29,7 @@ public class PatientInfoFacade extends PatientInfoServiceImpl {
      * @return
      */
     public List<PatientInfoDTO> getPatientInfo(@RequestBody PatientInfoVO patientInfoVO) {
-        List<PatientInfoDTO> patientInfoDTOList = this.getPatientInfos(patientInfoVO.getPatientCode(),patientInfoVO.getHosptialCode());
+        List<PatientInfoDTO> patientInfoDTOList = this.getPatientInfos(patientInfoVO.getPatientCode(),patientInfoVO.getHospitalCode());
         if(ListUtil.isEmpty(patientInfoDTOList)){
             throw new CommonException(CommonErrorCode.NOT_EXISTS,
                     "获取患者信息失败");

+ 0 - 14
icss-service/src/main/java/com/diagbot/facade/QuestionFacade.java

@@ -1,6 +1,5 @@
 package com.diagbot.facade;
 
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.diagbot.dto.QuestionDTO;
 import com.diagbot.entity.QuestionDetail;
 import com.diagbot.entity.QuestionInfo;
@@ -125,17 +124,4 @@ public class QuestionFacade extends QuestionInfoServiceImpl {
         }
         return data;
     }
-
-    /**
-     * 根据标签名获取标签信息
-     * @param questionInfo
-     * @return
-     */
-    public QuestionInfo getQuestionInfos(QuestionInfo questionInfo){
-        QueryWrapper<QuestionInfo> queryWrapper = new QueryWrapper<QuestionInfo>();
-        queryWrapper.eq("is_deleted", "N");
-        queryWrapper.eq("type", 1);
-        queryWrapper.eq("name",questionInfo.getName());
-        return this.getOne(queryWrapper);
-    }
 }

+ 1 - 1
icss-service/src/main/java/com/diagbot/vo/PatientInfoVO.java

@@ -16,5 +16,5 @@ public class PatientInfoVO {
     @NotNull(message = "请输入病人编码")
     private String patientCode;
     @NotNull(message = "请输入医院编码")
-    private String hosptialCode;
+    private String hospitalCode;
 }

+ 0 - 13
icss-service/src/main/java/com/diagbot/web/QuestionInfoController.java

@@ -3,7 +3,6 @@ package com.diagbot.web;
 
 import com.diagbot.dto.QuestionDTO;
 import com.diagbot.dto.RespDTO;
-import com.diagbot.entity.QuestionInfo;
 import com.diagbot.facade.QuestionFacade;
 import com.diagbot.vo.QuestionIdsVO;
 import com.diagbot.vo.QuestionVO;
@@ -54,16 +53,4 @@ public class QuestionInfoController {
         Map<Long, Object> data = questionFacade.getByIds(questionIdsVO);
         return RespDTO.onSuc(data);
     }
-
-
-    /**
-     * 获取疾病标签信息,远程调用[by:wangyu]
-     * @param questionInfo
-     * @return
-     */
-    @PostMapping("/getQuestionInfos")
-    public RespDTO<QuestionInfo> getQuestionInfos(@RequestBody QuestionInfo questionInfo){
-        QuestionInfo data = questionFacade.getQuestionInfos(questionInfo);
-        return RespDTO.onSuc(data);
-    }
 }

+ 0 - 26
icssman-service/src/main/java/com/diagbot/client/IcssServiceClient.java

@@ -1,26 +0,0 @@
-package com.diagbot.client;
-
-import com.diagbot.client.hystrix.IcssServiceHystrix;
-import com.diagbot.dto.DeptInfoDTO;
-import com.diagbot.dto.RespDTO;
-import com.diagbot.entity.QuestionInfo;
-import com.diagbot.vo.DeptInfoVO;
-import org.springframework.cloud.openfeign.FeignClient;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-
-import java.util.List;
-
-/**
- * @Description:
- * @author: wangyu
- * @time: 2018/12/3 17:46
- */
-@FeignClient(value = "icss-service", fallback = IcssServiceHystrix.class)
-public interface IcssServiceClient {
-    @PostMapping("/deptInfo/getDeptInfo")
-    RespDTO<List<DeptInfoDTO>> getDeptInfo(@RequestBody DeptInfoVO deptInfoVO);
-
-    @PostMapping("/questionInfo/getQuestionInfos")
-    RespDTO<QuestionInfo> getQuestionInfos(@RequestBody QuestionInfo questionInfo);
-}

+ 5 - 3
icssman-service/src/main/java/com/diagbot/client/UserServiceClient.java

@@ -2,11 +2,13 @@ package com.diagbot.client;
 
 import com.diagbot.client.hystrix.UserServiceHystrix;
 import com.diagbot.dto.RespDTO;
-import com.diagbot.entity.Token;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 
+import java.util.List;
+import java.util.Map;
+
 
 /**
  * @Description: 调用用户服务
@@ -16,8 +18,8 @@ import org.springframework.web.bind.annotation.RequestBody;
 @FeignClient(value = "user-service", fallback = UserServiceHystrix.class)
 public interface UserServiceClient {
 
-    @PostMapping("/user/verifyToken")
-    RespDTO<Boolean> verifyToken(@RequestBody Token token);
+    @PostMapping(value = "/user/getUserInfoByIds")
+    RespDTO<Map<String, String>> getUserInfoByIds(@RequestBody List<String> ids);
 }
 
 

+ 0 - 33
icssman-service/src/main/java/com/diagbot/client/hystrix/IcssServiceHystrix.java

@@ -1,33 +0,0 @@
-package com.diagbot.client.hystrix;
-
-import com.diagbot.client.IcssServiceClient;
-import com.diagbot.dto.DeptInfoDTO;
-import com.diagbot.dto.RespDTO;
-import com.diagbot.entity.QuestionInfo;
-import com.diagbot.vo.DeptInfoVO;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.stereotype.Component;
-
-import java.util.List;
-
-
-/**
- * @Description: 调用Icss服务
- * @author: gaodm
- * @time: 2018/8/6 9:52
- */
-@Component
-@Slf4j
-public class IcssServiceHystrix implements IcssServiceClient {
-    @Override
-    public RespDTO<List<DeptInfoDTO>> getDeptInfo(DeptInfoVO deptInfoVO) {
-        log.error("【hystrix】调用{}异常", "getDeptInfo");
-        return null;
-    }
-
-    @Override
-    public RespDTO<QuestionInfo> getQuestionInfos(QuestionInfo questionInfo) {
-        log.error("【hystrix】调用{}异常", "getQuestionInfos");
-        return null;
-    }
-}

+ 9 - 5
icssman-service/src/main/java/com/diagbot/client/hystrix/UserServiceHystrix.java

@@ -2,10 +2,12 @@ package com.diagbot.client.hystrix;
 
 import com.diagbot.client.UserServiceClient;
 import com.diagbot.dto.RespDTO;
-import com.diagbot.entity.Token;
-import com.diagbot.entity.User;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Component;
+import org.springframework.web.bind.annotation.RequestBody;
+
+import java.util.List;
+import java.util.Map;
 
 
 /**
@@ -17,10 +19,12 @@ import org.springframework.stereotype.Component;
 @Slf4j
 public class UserServiceHystrix implements UserServiceClient {
 
-    @Override
-    public RespDTO<Boolean> verifyToken(Token token) {
-        log.error("【hystrix】调用{}异常", "verifyToken");
+	@Override
+    public RespDTO<Map<String, String>> getUserInfoByIds(@RequestBody List<String> ids){
+        log.error("【hystrix】调用{}异常", "getUserInfoByIds");
         return null;
     }
 
+    
+    
 }

+ 1 - 1
icssman-service/src/main/java/com/diagbot/entity/IntroduceDetail.java

@@ -76,7 +76,7 @@ public class IntroduceDetail implements Serializable {
     private Integer orderNo;
 
     /**
-     * 显示位置:1-右侧显示,0-都显
+     * 显示位置:0-都展示,1-推送展示,2-更多展
      */
     private Integer position;
 

+ 0 - 142
icssman-service/src/main/java/com/diagbot/entity/User.java

@@ -1,142 +0,0 @@
-package com.diagbot.entity;
-
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-
-import java.io.Serializable;
-import java.util.Date;
-
-/**
- * <p>
- * 系统用户表
- * </p>
- *
- * @author gaodm
- * @since 2018-08-30
- */
-@TableName("sys_user")
-public class User implements Serializable {
-
-    private static final long serialVersionUID = 1L;
-
-    /**
-     * 用户ID
-     */
-    @TableId(value = "id", type = IdType.AUTO)
-    private Long id;
-
-    /**
-     * 是否删除,N:未删除,Y:删除
-     */
-    private String isDeleted;
-
-    /**
-     * 记录创建时间
-     */
-    private Date gmtCreate;
-
-    /**
-     * 记录修改时间,如果时间是1970年则表示纪录未修改
-     */
-    private Date gmtModified;
-
-    /**
-     * 创建人,0表示无创建人值
-     */
-    private String creator;
-
-    /**
-     * 修改人,如果为0则表示纪录未修改
-     */
-    private String modifier;
-
-    /**
-     * 用户密码
-     */
-    private String password;
-
-    /**
-     * 用户名
-     */
-    private String username;
-
-
-    public Long getId() {
-        return id;
-    }
-
-    public void setId(Long id) {
-        this.id = id;
-    }
-
-    public String getIsDeleted() {
-        return isDeleted;
-    }
-
-    public void setIsDeleted(String isDeleted) {
-        this.isDeleted = isDeleted;
-    }
-
-    public Date getGmtCreate() {
-        return gmtCreate;
-    }
-
-    public void setGmtCreate(Date gmtCreate) {
-        this.gmtCreate = gmtCreate;
-    }
-
-    public Date getGmtModified() {
-        return gmtModified;
-    }
-
-    public void setGmtModified(Date gmtModified) {
-        this.gmtModified = gmtModified;
-    }
-
-    public String getCreator() {
-        return creator;
-    }
-
-    public void setCreator(String creator) {
-        this.creator = creator;
-    }
-
-    public String getModifier() {
-        return modifier;
-    }
-
-    public void setModifier(String modifier) {
-        this.modifier = modifier;
-    }
-
-    public String getPassword() {
-        return password;
-    }
-
-    public void setPassword(String password) {
-        this.password = password;
-    }
-
-    public String getUsername() {
-        return username;
-    }
-
-    public void setUsername(String username) {
-        this.username = username;
-    }
-
-    @Override
-    public String toString() {
-        return "User{" +
-                "id=" + id +
-                ", isDeleted=" + isDeleted +
-                ", gmtCreate=" + gmtCreate +
-                ", gmtModified=" + gmtModified +
-                ", creator=" + creator +
-                ", modifier=" + modifier +
-                ", password=" + password +
-                ", username=" + username +
-                "}";
-    }
-}

+ 3 - 2
icssman-service/src/main/java/com/diagbot/enums/IntroducePositionEnum.java

@@ -9,8 +9,9 @@ import lombok.Setter;
  * @time: 2018/11/23 10:12
  */
 public enum IntroducePositionEnum implements KeyedNamed {
-    Right(1, "右侧"),
-    All(0, "右侧+全文");
+    All(0, "都展示"),
+    Push(1, "推送展示"),
+    More(2, "更多展示");
 
     @Setter
     private Integer key;

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

@@ -15,6 +15,8 @@ import com.diagbot.vo.GetDeptInfoVO;
 import com.diagbot.vo.UpdateDeptInfoVO;
 import org.springframework.stereotype.Component;
 
+import java.util.Date;
+
 /**
  * @Description:
  * @Author:zhaops
@@ -31,8 +33,12 @@ public class DeptInfoFacade extends DeptInfoServiceImpl {
     public Boolean addDeptInfo(AddDeptInfoVO addDeptInfoVO) {
         DeptInfo deptInfo =new DeptInfo();
         BeanUtil.copyProperties(addDeptInfoVO,deptInfo);
-        deptInfo.setCreator(UserUtils.getCurrentPrincipleID());
-        deptInfo.setGmtCreate(DateUtil.now());
+        Date now = DateUtil.now();
+        String userId = UserUtils.getCurrentPrincipleID();
+        deptInfo.setCreator(userId);
+        deptInfo.setGmtCreate(now);
+        deptInfo.setModifier(userId);
+        deptInfo.setGmtModified(now);
         Boolean flag = this.save(deptInfo);
         if(!flag){
             throw new CommonException(CommonErrorCode.FAIL,

+ 30 - 13
icssman-service/src/main/java/com/diagbot/facade/DeptVitalFacade.java

@@ -1,6 +1,7 @@
 package com.diagbot.facade;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.diagbot.entity.DeptVital;
 import com.diagbot.entity.QuestionInfo;
 import com.diagbot.enums.IsDeleteEnum;
@@ -9,11 +10,11 @@ import com.diagbot.exception.CommonErrorCode;
 import com.diagbot.exception.CommonException;
 import com.diagbot.service.DeptVitalService;
 import com.diagbot.service.impl.DeptVitalServiceImpl;
+import com.diagbot.util.DateUtil;
 import com.diagbot.util.EntityUtil;
 import com.diagbot.util.UserUtils;
 import com.diagbot.vo.DeptVitalVO;
 import com.google.common.collect.Lists;
-import org.aspectj.weaver.patterns.TypePatternQuestions;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
@@ -43,9 +44,13 @@ public class DeptVitalFacade extends DeptVitalServiceImpl implements DeptVitalSe
      */
     public Boolean saveDeptVitals(DeptVitalVO deptVitalVO) {
         //先删除该科室原有模板
-        QueryWrapper<DeptVital> deptVitalQueryWrapper = new QueryWrapper<DeptVital>();
-        deptVitalQueryWrapper.eq("dept_id", deptVitalVO.getDeptId());
-        this.remove(deptVitalQueryWrapper);
+        UpdateWrapper<DeptVital> deptVitalUpdateWrapper = new UpdateWrapper<>();
+        deptVitalUpdateWrapper.eq("dept_id", deptVitalVO.getDeptId()).
+                eq("is_deleted",IsDeleteEnum.N.getKey()).
+                set("is_deleted", IsDeleteEnum.Y.getKey()).
+                set("modifier", UserUtils.getCurrentPrincipleID()).
+                set("gmt_modified", DateUtil.now());
+        this.update(new DeptVital(),deptVitalUpdateWrapper);
 
         //查找标签是否存在
         QueryWrapper<QuestionInfo> questionInfoQueryWrapper = new QueryWrapper<>();
@@ -63,12 +68,16 @@ public class DeptVitalFacade extends DeptVitalServiceImpl implements DeptVitalSe
 
         //插入新模板
         List<DeptVital> deptVitalList = Lists.newArrayList();
+        Date now = DateUtil.now();
+        String userId = UserUtils.getCurrentPrincipleID();
         for (Long vital : deptVitalVO.getVitalIds()) {
             DeptVital deptVital = new DeptVital();
             deptVital.setDeptId(deptVitalVO.getDeptId());
             deptVital.setVitalId(vital);
-            deptVital.setCreator(UserUtils.getCurrentPrincipleID());
-            deptVital.setGmtCreate(new Date());
+            deptVital.setCreator(userId);
+            deptVital.setGmtCreate(now);
+            deptVital.setModifier(userId);
+            deptVital.setGmtModified(now);
             deptVitalList.add(deptVital);
         }
 
@@ -83,10 +92,14 @@ public class DeptVitalFacade extends DeptVitalServiceImpl implements DeptVitalSe
      * @return
      */
     public Boolean delDeptVitalList(DeptVitalVO deptVitalVO) {
-        QueryWrapper<DeptVital> deptVitalQueryWrapper = new QueryWrapper<DeptVital>();
-        deptVitalQueryWrapper.eq("dept_id", deptVitalVO.getDeptId()).
-                in("vital_id", deptVitalVO.getVitalIds());
-        this.remove(deptVitalQueryWrapper);
+        UpdateWrapper<DeptVital> deptVitalUpdateWrapper = new UpdateWrapper<>();
+        deptVitalUpdateWrapper.eq("dept_id", deptVitalVO.getDeptId()).
+                in("vital_id", deptVitalVO.getVitalIds()).
+                eq("is_deleted", IsDeleteEnum.N.getKey()).
+                set("is_deleted", IsDeleteEnum.Y.getKey()).
+                set("modifier", UserUtils.getCurrentPrincipleID()).
+                set("gmt_modified", DateUtil.now());
+        this.update(new DeptVital(), deptVitalUpdateWrapper);
         return true;
     }
 
@@ -96,9 +109,13 @@ public class DeptVitalFacade extends DeptVitalServiceImpl implements DeptVitalSe
      * @return
      */
     public Boolean delAllDeptVitalList(Long deptId) {
-        QueryWrapper<DeptVital> deptVitalQueryWrapper = new QueryWrapper<DeptVital>();
-        deptVitalQueryWrapper.eq("dept_id", deptId);
-        this.remove(deptVitalQueryWrapper);
+        UpdateWrapper<DeptVital> deptVitalUpdateWrapper = new UpdateWrapper<>();
+        deptVitalUpdateWrapper.eq("dept_id", deptId).
+                eq("is_deleted", IsDeleteEnum.N.getKey()).
+                set("is_deleted", IsDeleteEnum.Y.getKey()).
+                set("modifier", UserUtils.getCurrentPrincipleID()).
+                set("gmt_modified", DateUtil.now());
+        this.update(new DeptVital(), deptVitalUpdateWrapper);
         return true;
     }
 

+ 39 - 1
icssman-service/src/main/java/com/diagbot/facade/IntroduceDetailFacade.java

@@ -1,9 +1,12 @@
 package com.diagbot.facade;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.diagbot.entity.IntroduceDetail;
 import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.service.impl.IntroduceDetailServiceImpl;
+import com.diagbot.util.DateUtil;
+import com.diagbot.util.UserUtils;
 import org.springframework.stereotype.Component;
 
 import java.util.List;
@@ -18,6 +21,7 @@ public class IntroduceDetailFacade extends IntroduceDetailServiceImpl {
 
     /**
      * 获取提示信息明细
+     *
      * @param introduceId
      * @return
      */
@@ -27,4 +31,38 @@ public class IntroduceDetailFacade extends IntroduceDetailServiceImpl {
                 eq("introduce_id", introduceId);
         return this.list(introduceDetailQueryWrapper);
     }
-}
+
+    /**
+     * 单条删除提示信息明细 逻辑删除
+     *
+     * @param id
+     * @return
+     */
+    public Boolean deleteRecord(Long id) {
+        UpdateWrapper<IntroduceDetail> introduceDetailUpdateWrapper = new UpdateWrapper<>();
+        introduceDetailUpdateWrapper.eq("id", id).
+                eq("is_deleted", IsDeleteEnum.N.getKey()).
+                set("is_deleted", IsDeleteEnum.Y.getKey()).
+                set("modifier", UserUtils.getCurrentPrincipleID()).
+                set("gmt_modified", DateUtil.now());
+        this.update(new IntroduceDetail(), introduceDetailUpdateWrapper);
+        return true;
+    }
+
+    /**
+     * 批量删除提示信息明细 逻辑删除
+     *
+     * @param ids
+     * @return
+     */
+    public Boolean deleteRecords(Long[] ids) {
+        UpdateWrapper<IntroduceDetail> introduceDetailUpdateWrapper = new UpdateWrapper<>();
+        introduceDetailUpdateWrapper.in("id", ids).
+                eq("is_deleted", IsDeleteEnum.N.getKey()).
+                set("is_deleted", IsDeleteEnum.Y.getKey()).
+                set("modifier", UserUtils.getCurrentPrincipleID()).
+                set("gmt_modified", DateUtil.now());
+        this.update(new IntroduceDetail(), introduceDetailUpdateWrapper);
+        return true;
+    }
+}

+ 65 - 28
icssman-service/src/main/java/com/diagbot/facade/IntroduceInfoFacade.java

@@ -1,14 +1,17 @@
 package com.diagbot.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.diagbot.entity.IntroduceDetail;
 import com.diagbot.entity.IntroduceInfo;
 import com.diagbot.entity.IntroduceMap;
+import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.service.impl.IntroduceDetailServiceImpl;
 import com.diagbot.service.impl.IntroduceInfoServiceImpl;
 import com.diagbot.service.impl.IntroduceMapServiceImpl;
 import com.diagbot.util.BeanUtil;
+import com.diagbot.util.DateUtil;
 import com.diagbot.util.UserUtils;
 import com.diagbot.vo.IntroduceDetailVO;
 import com.diagbot.vo.IntroduceMapVO;
@@ -18,8 +21,6 @@ import com.google.common.collect.Lists;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
-import java.util.Arrays;
-import java.util.Date;
 import java.util.List;
 import java.util.Map;
 
@@ -50,10 +51,10 @@ public class IntroduceInfoFacade extends IntroduceInfoServiceImpl {
         if (!(introduceVO.getId() == null)) {
             introduceInfo = this.getById(introduceVO.getId());
             introduceInfo.setModifier(UserUtils.getCurrentPrincipleID());
-            introduceInfo.setGmtModified(new Date());
+            introduceInfo.setGmtModified(DateUtil.now());
         } else {
             introduceInfo.setCreator(UserUtils.getCurrentPrincipleID());
-            introduceInfo.setGmtCreate(new Date());
+            introduceInfo.setGmtCreate(DateUtil.now());
         }
         introduceInfo.setName(introduceVO.getName());
         introduceInfo.setRemark(introduceVO.getRemark());
@@ -62,18 +63,22 @@ public class IntroduceInfoFacade extends IntroduceInfoServiceImpl {
         this.saveOrUpdate(introduceInfo);
 
         //明细信息不更新,每次都删除重新插入
-        //删除已有明细,物理删除
+        //删除已有明细,逻辑删除
         if (!(introduceInfo.getId() == null)) {
-            QueryWrapper<IntroduceDetail> detailQueryWrapper = new QueryWrapper<>();
-            detailQueryWrapper.eq("introduce_id", introduceInfo.getId());
-            introduceDetailFacade.remove(detailQueryWrapper);
+            UpdateWrapper<IntroduceDetail> detailUpdateWrapper = new UpdateWrapper<>();
+            detailUpdateWrapper.eq("introduce_id", introduceInfo.getId()).
+                    eq("is_deleted", IsDeleteEnum.N.getKey()).
+                    set("is_deleted", IsDeleteEnum.Y.getKey()).
+                    set("modifier", UserUtils.getCurrentPrincipleID()).
+                    set("gmt_modified", DateUtil.now());
+            introduceDetailFacade.update(new IntroduceDetail(), detailUpdateWrapper);
         }
         List<IntroduceDetail> introduceDetailList = Lists.newArrayList();
         for (IntroduceDetailVO detailVO : introduceVO.getDetailVOList()) {
             IntroduceDetail detail = new IntroduceDetail();
             detail.setIntroduceId(introduceInfo.getId());
             detail.setCreator(UserUtils.getCurrentPrincipleID());
-            detail.setGmtCreate(new Date());
+            detail.setGmtCreate(DateUtil.now());
             detail.setContent(detailVO.getContent());
             detail.setText(detailVO.getText());
             detail.setTitle(detailVO.getTitle());
@@ -87,9 +92,13 @@ public class IntroduceInfoFacade extends IntroduceInfoServiceImpl {
 
         //更新映射关系
         //删除已有映射关系
-        QueryWrapper<IntroduceMap> introduceMapQueryWrapper = new QueryWrapper<>();
-        introduceMapQueryWrapper.eq("introduce_id", introduceInfo.getId());
-        introduceMapFacade.remove(introduceMapQueryWrapper);
+        UpdateWrapper<IntroduceMap> introduceMapUpdateWrapper = new UpdateWrapper<>();
+        introduceMapUpdateWrapper.eq("introduce_id", introduceInfo.getId()).
+                eq("is_deleted", IsDeleteEnum.N.getKey()).
+                set("is_deleted", IsDeleteEnum.Y.getKey()).
+                set("modifier", UserUtils.getCurrentPrincipleID()).
+                set("gmt_modified", DateUtil.now());
+        introduceMapFacade.update(new IntroduceMap(), introduceMapUpdateWrapper);
         //插入新的映射关系
         List<IntroduceMap> introduceMapList = Lists.newLinkedList();
         for (IntroduceMapVO introduceMapVO : introduceVO.getMapVOList()) {
@@ -103,42 +112,70 @@ public class IntroduceInfoFacade extends IntroduceInfoServiceImpl {
     }
 
     /**
-     * 单条删除提示信息 物理删除
+     * 单条删除提示信息 逻辑删除
      *
      * @param id
      * @return
      */
     public Boolean deleteRecord(Long id) {
         //删除已有映射关系
-        QueryWrapper<IntroduceMap> introduceMapQueryWrapper = new QueryWrapper<>();
-        introduceMapQueryWrapper.eq("introduce_id", id);
-        introduceMapFacade.remove(introduceMapQueryWrapper);
+        UpdateWrapper<IntroduceMap> introduceMapUpdateWrapper = new UpdateWrapper<>();
+        introduceMapUpdateWrapper.eq("introduce_id", id).
+                eq("is_deleted", IsDeleteEnum.N.getKey()).
+                set("is_deleted", IsDeleteEnum.Y.getKey()).
+                set("modifier", UserUtils.getCurrentPrincipleID()).
+                set("gmt_modified", DateUtil.now());
+        introduceMapFacade.update(new IntroduceMap(), introduceMapUpdateWrapper);
         //删除明细
-        QueryWrapper<IntroduceDetail> introduceDetailQueryWrapper = new QueryWrapper<>();
-        introduceDetailQueryWrapper.eq("introduce_id", id);
-        introduceDetailFacade.remove(introduceDetailQueryWrapper);
+        UpdateWrapper<IntroduceDetail> introduceDetailUpdateWrapper = new UpdateWrapper<>();
+        introduceDetailUpdateWrapper.eq("introduce_id", id).
+                eq("is_deleted", IsDeleteEnum.N.getKey()).
+                set("is_deleted", IsDeleteEnum.Y.getKey()).
+                set("modifier", UserUtils.getCurrentPrincipleID()).
+                set("gmt_modified", DateUtil.now());
+        introduceDetailFacade.update(new IntroduceDetail(), introduceDetailUpdateWrapper);
         //删除提示信息
-        this.removeById(id);
+        UpdateWrapper<IntroduceInfo> introduceInfoUpdateWrapper = new UpdateWrapper<>();
+        introduceInfoUpdateWrapper.eq("id", id).
+                eq("is_deleted", IsDeleteEnum.N.getKey()).
+                set("is_deleted", IsDeleteEnum.Y.getKey()).
+                set("modifier", UserUtils.getCurrentPrincipleID()).
+                set("gmt_modified", DateUtil.now());
+        this.update(new IntroduceInfo(), introduceInfoUpdateWrapper);
         return true;
     }
 
     /**
-     * 批量删除提示信息 物理删除
+     * 批量删除提示信息 逻辑删除
      *
      * @param ids
      * @return
      */
     public Boolean deleteRecords(Long[] ids) {
         //删除已有映射关系
-        QueryWrapper<IntroduceMap> introduceMapQueryWrapper = new QueryWrapper<>();
-        introduceMapQueryWrapper.in("introduce_id", ids);
-        introduceMapFacade.remove(introduceMapQueryWrapper);
+        UpdateWrapper<IntroduceMap> introduceMapUpdateWrapper = new UpdateWrapper<>();
+        introduceMapUpdateWrapper.in("introduce_id", ids).
+                eq("is_deleted", IsDeleteEnum.N.getKey()).
+                set("is_deleted", IsDeleteEnum.Y.getKey()).
+                set("modifier", UserUtils.getCurrentPrincipleID()).
+                set("gmt_modified", DateUtil.now());
+        introduceMapFacade.update(new IntroduceMap(), introduceMapUpdateWrapper);
         //删除明细
-        QueryWrapper<IntroduceDetail> introduceDetailQueryWrapper = new QueryWrapper<>();
-        introduceDetailQueryWrapper.in("introduce_id", ids);
-        introduceDetailFacade.remove(introduceDetailQueryWrapper);
+        UpdateWrapper<IntroduceDetail> introduceDetailUpdateWrapper = new UpdateWrapper<>();
+        introduceDetailUpdateWrapper.in("introduce_id", ids).
+                eq("is_deleted", IsDeleteEnum.N.getKey()).
+                set("is_deleted", IsDeleteEnum.Y.getKey()).
+                set("modifier", UserUtils.getCurrentPrincipleID()).
+                set("gmt_modified", DateUtil.now());
+        introduceDetailFacade.update(new IntroduceDetail(), introduceDetailUpdateWrapper);
         //删除提示信息
-        this.removeByIds(Arrays.asList(ids));
+        UpdateWrapper<IntroduceInfo> introduceInfoUpdateWrapper = new UpdateWrapper<>();
+        introduceInfoUpdateWrapper.in("id", ids).
+                eq("is_deleted", IsDeleteEnum.N.getKey()).
+                set("is_deleted", IsDeleteEnum.Y.getKey()).
+                set("modifier", UserUtils.getCurrentPrincipleID()).
+                set("gmt_modified", DateUtil.now());
+        this.update(new IntroduceInfo(), introduceInfoUpdateWrapper);
         return true;
     }
 

+ 13 - 8
icssman-service/src/main/java/com/diagbot/facade/IntroduceMapFacade.java

@@ -8,13 +8,12 @@ import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.exception.CommonErrorCode;
 import com.diagbot.exception.CommonException;
 import com.diagbot.service.impl.IntroduceMapServiceImpl;
+import com.diagbot.util.DateUtil;
 import com.diagbot.util.UserUtils;
 import com.diagbot.vo.IntroduceMapVO;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
-import java.util.Date;
-
 /**
  * @Description:
  * @Author:zhaops
@@ -50,8 +49,11 @@ public class IntroduceMapFacade extends IntroduceMapServiceImpl {
             UpdateWrapper<IntroduceMap> introduceMapUpdateWrapper = new UpdateWrapper<>();
             introduceMapUpdateWrapper.eq("is_deleted", IsDeleteEnum.N.getKey()).
                     eq("question_id", introduceMapVO.getQuestionId()).
-                    eq("type", introduceMapVO.getType());
-            this.remove(introduceMapUpdateWrapper);
+                    eq("type", introduceMapVO.getType()).
+                    set("is_deleted", IsDeleteEnum.Y.getKey()).
+                    set("modifier", UserUtils.getCurrentPrincipleID()).
+                    set("gmt_modified", DateUtil.now());
+            this.update(new IntroduceMap(), introduceMapUpdateWrapper);
 
             //插入新的关系
             introduceMap = new IntroduceMap();
@@ -59,10 +61,10 @@ public class IntroduceMapFacade extends IntroduceMapServiceImpl {
             introduceMap.setIntroduceId(introduceMapVO.getIntroduceId());
             introduceMap.setType(introduceMapVO.getType());
             introduceMap.setCreator(UserUtils.getCurrentPrincipleID());
-            introduceMap.setGmtCreate(new Date());
+            introduceMap.setGmtCreate(DateUtil.now());
         } else {
             //已有关系更新时间
-            introduceMap.setGmtModified(new Date());
+            introduceMap.setGmtModified(DateUtil.now());
             introduceMap.setModifier(UserUtils.getCurrentPrincipleID());
         }
         this.saveOrUpdate(introduceMap);
@@ -78,10 +80,13 @@ public class IntroduceMapFacade extends IntroduceMapServiceImpl {
     public Boolean delIntroduceMap(IntroduceMapVO introduceMapVO) {
         UpdateWrapper<IntroduceMap> introduceMapUpdateWrapper = new UpdateWrapper<>();
         introduceMapUpdateWrapper.eq("is_deleted", IsDeleteEnum.N.getKey()).
+                eq("introduce_id", introduceMapVO.getIntroduceId()).
                 eq("question_id", introduceMapVO.getQuestionId()).
                 eq("type", introduceMapVO.getType()).
-                set("is_deleted", IsDeleteEnum.Y.getKey());
+                set("is_deleted", IsDeleteEnum.Y.getKey()).
+                set("modifier", UserUtils.getCurrentPrincipleID()).
+                set("gmt_modified", DateUtil.now());
         this.update(new IntroduceMap(), introduceMapUpdateWrapper);
         return true;
     }
-}
+}

+ 14 - 0
icssman-service/src/main/java/com/diagbot/facade/QuestionInfoFacade.java

@@ -1,5 +1,6 @@
 package com.diagbot.facade;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.diagbot.dto.QuestionIndexDTO;
 import com.diagbot.entity.QuestionInfo;
 import com.diagbot.enums.IsDeleteEnum;
@@ -78,4 +79,17 @@ public class QuestionInfoFacade extends QuestionInfoServiceImpl {
         paramMap.put("type", questionIndexDTO.getType());
         return this.index(paramMap);
     }
+
+    /**
+     * 根据标签名获取标签信息
+     * @param questionInfo
+     * @return
+     */
+    public QuestionInfo getQuestionInfos(QuestionInfo questionInfo){
+        QueryWrapper<QuestionInfo> queryWrapper = new QueryWrapper<QuestionInfo>();
+        queryWrapper.eq("is_deleted", "N");
+        queryWrapper.eq("type", 1);
+        queryWrapper.eq("name",questionInfo.getName());
+        return this.getOne(queryWrapper);
+    }
 }

+ 21 - 9
icssman-service/src/main/java/com/diagbot/facade/QuestionUsualFacade.java

@@ -1,8 +1,8 @@
 package com.diagbot.facade;
 
-import com.diagbot.client.IcssServiceClient;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.diagbot.dto.DeptInfoDTO;
-import com.diagbot.dto.RespDTO;
 import com.diagbot.entity.QuestionInfo;
 import com.diagbot.entity.QuestionUsual;
 import com.diagbot.enums.IsDeleteEnum;
@@ -11,6 +11,7 @@ import com.diagbot.exception.CommonException;
 import com.diagbot.service.impl.QuestionUsualServiceImpl;
 import com.diagbot.util.BeanUtil;
 import com.diagbot.util.DateUtil;
+import com.diagbot.util.ListUtil;
 import com.diagbot.util.UserUtils;
 import com.diagbot.vo.DeptInfoVO;
 import com.diagbot.vo.QuestionUsualVO;
@@ -28,7 +29,9 @@ import java.util.List;
 @Component
 public class QuestionUsualFacade extends QuestionUsualServiceImpl {
     @Autowired
-    private IcssServiceClient icssServiceClient ;
+    private QuestionInfoFacade questionInfoFacade ;
+    @Autowired
+    private DeptInfoFacade deptInfoFacade;
 
     /**
      * 添加常用标签
@@ -39,22 +42,22 @@ public class QuestionUsualFacade extends QuestionUsualServiceImpl {
         DeptInfoVO deptInfoVO =new DeptInfoVO();
         QuestionInfo questionInfo =new QuestionInfo();
         BeanUtil.copyProperties(questionUsualVO,deptInfoVO);
-        RespDTO<List<DeptInfoDTO>> listRespDTO = icssServiceClient.getDeptInfo(deptInfoVO);
-        if (listRespDTO == null || !"0".equals(listRespDTO.code)) {
+        List<DeptInfoDTO> listRespDTO = deptInfoFacade.getDeptInfos(questionUsualVO.getDeptCode(),questionUsualVO.getHospitalCode());
+        if (ListUtil.isEmpty(listRespDTO)) {
             throw new CommonException(CommonErrorCode.RPC_ERROR,
                     "获取科室信息失败");
         }
         questionInfo.setName(questionUsualVO.getQuestionName());
-        RespDTO<QuestionInfo> questionInfoRespDTO = icssServiceClient.getQuestionInfos(questionInfo);
-        if (questionInfoRespDTO == null || !"0".equals(questionInfoRespDTO.code)) {
+        QuestionInfo questionInfoRespDTO = questionInfoFacade.getQuestionInfos(questionInfo);
+        if (questionInfoRespDTO == null) {
             throw new CommonException(CommonErrorCode.RPC_ERROR,
                     "获取标签信息失败");
         }
         QuestionUsual questionUsual = new QuestionUsual();
         questionUsual.setCreator(UserUtils.getCurrentPrincipleID());
         questionUsual.setGmtCreate(DateUtil.now());
-        questionUsual.setQuestionId(questionInfoRespDTO.data.getId());
-        questionUsual.setDeptId(listRespDTO.data.get(0).getId());
+        questionUsual.setQuestionId(questionInfoRespDTO.getId());
+        questionUsual.setDeptId(listRespDTO.get(0).getId());
         Boolean flag = this.save(questionUsual);
         if(!flag){
             throw new CommonException(CommonErrorCode.FAIL,
@@ -99,4 +102,13 @@ public class QuestionUsualFacade extends QuestionUsualServiceImpl {
         }
         return flag;
     }
+
+    /**
+     * 获取常用标签信息(还不确定返回内容)
+     * @return
+     */
+    public IPage<QuestionUsual> getQuestionUsual(){
+        IPage iPage =new Page();
+       return iPage;
+    }
 }

+ 25 - 13
icssman-service/src/main/java/com/diagbot/facade/VitalOrderFacade.java

@@ -1,20 +1,20 @@
 package com.diagbot.facade;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.diagbot.dto.VitalInfoDTO;
 import com.diagbot.entity.QuestionInfo;
 import com.diagbot.entity.VitalOrder;
+import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.service.impl.VitalOrderServiceImpl;
-import com.diagbot.util.BeanUtil;
+import com.diagbot.util.DateUtil;
 import com.diagbot.util.EntityUtil;
 import com.diagbot.util.UserUtils;
 import com.diagbot.vo.VitalOrderVO;
 import com.google.common.collect.Lists;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.context.properties.EnableConfigurationProperties;
 import org.springframework.stereotype.Component;
 
-import java.util.Date;
 import java.util.List;
 import java.util.Map;
 
@@ -33,8 +33,12 @@ public class VitalOrderFacade extends VitalOrderServiceImpl {
 
     public Boolean saveAll(List<VitalOrderVO> vitalOrderVOList) {
         //先删除现有排序
-        QueryWrapper<VitalOrder> vitalOrderQueryWrapper = new QueryWrapper<>();
-        this.remove(vitalOrderQueryWrapper);
+        UpdateWrapper<VitalOrder> vitalOrderUpdateWrapper = new UpdateWrapper<>();
+        vitalOrderUpdateWrapper.eq("is_deleted", IsDeleteEnum.N.getKey()).
+                set("is_deleted", IsDeleteEnum.Y.getKey()).
+                set("modifier", UserUtils.getCurrentPrincipleID()).
+                set("gmt_modified", DateUtil.now());
+        this.update(new VitalOrder(), vitalOrderUpdateWrapper);
         //插入新排序
         List<VitalOrder> vitalOrderList = Lists.newArrayList();
         for (VitalOrderVO vitalOrderVO : vitalOrderVOList) {
@@ -42,7 +46,7 @@ public class VitalOrderFacade extends VitalOrderServiceImpl {
             vitalOrder.setQuestionId(vitalOrderVO.getVitalId());
             vitalOrder.setOrderNo(vitalOrderVO.getOrderNo());
             vitalOrder.setCreator(UserUtils.getCurrentPrincipleID());
-            vitalOrder.setGmtCreate(new Date());
+            vitalOrder.setGmtCreate(DateUtil.now());
             vitalOrderList.add(vitalOrder);
         }
         vitalOrderServiceImpl.saveBatch(vitalOrderList);
@@ -81,9 +85,13 @@ public class VitalOrderFacade extends VitalOrderServiceImpl {
      * @return
      */
     public Boolean deleteVitalOrder(Long vitalId) {
-        QueryWrapper<VitalOrder> vitalOrderQueryWrapper = new QueryWrapper<>();
-        vitalOrderQueryWrapper.eq("vital_id", vitalId);
-        this.remove(vitalOrderQueryWrapper);
+        UpdateWrapper<VitalOrder> vitalOrderUpdateWrapper = new UpdateWrapper<>();
+        vitalOrderUpdateWrapper.eq("vital_id", vitalId).
+                eq("is_deleted", IsDeleteEnum.N.getKey()).
+                set("is_deleted", IsDeleteEnum.Y.getKey()).
+                set("modifier", UserUtils.getCurrentPrincipleID()).
+                set("gmt_modified", DateUtil.now());
+        this.update(new VitalOrder(), vitalOrderUpdateWrapper);
         return true;
     }
 
@@ -94,9 +102,13 @@ public class VitalOrderFacade extends VitalOrderServiceImpl {
      * @return
      */
     public Boolean deleteVitalOrders(Long[] vitalIds) {
-        QueryWrapper<VitalOrder> vitalOrderQueryWrapper = new QueryWrapper<>();
-        vitalOrderQueryWrapper.in("vital_id", vitalIds);
-        this.remove(vitalOrderQueryWrapper);
+        UpdateWrapper<VitalOrder> vitalOrderUpdateWrapper = new UpdateWrapper<>();
+        vitalOrderUpdateWrapper.in("vital_id", vitalIds).
+                eq("is_deleted", IsDeleteEnum.N.getKey()).
+                set("is_deleted", IsDeleteEnum.Y.getKey()).
+                set("modifier", UserUtils.getCurrentPrincipleID()).
+                set("gmt_modified", DateUtil.now());
+        this.update(new VitalOrder(), vitalOrderUpdateWrapper);
         return true;
     }
-}
+}

+ 13 - 1
icssman-service/src/main/java/com/diagbot/mapper/DeptInfoMapper.java

@@ -2,8 +2,12 @@ package com.diagbot.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.dto.DeptInfoDTO;
 import com.diagbot.entity.DeptInfo;
 import com.diagbot.vo.GetDeptInfoVO;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 /**
  * <p>
@@ -16,9 +20,17 @@ import com.diagbot.vo.GetDeptInfoVO;
 public interface DeptInfoMapper extends BaseMapper<DeptInfo> {
 
     /**
-     * 获取科室信息
+     * 分页获取科室信息
      * @param getDeptInfoVO
      * @return
      */
     public IPage<DeptInfo> getAllDeptInfo(GetDeptInfoVO getDeptInfoVO);
+
+    /**
+     *  获取科室信息和
+     * @param deptCode
+     * @param hospitalCode
+     * @return
+     */
+    public List<DeptInfoDTO> getDeptInfos(@Param("deptCode") String deptCode,@Param("hospitalCode") String hospitalCode);
 }

+ 2 - 0
icssman-service/src/main/java/com/diagbot/mapper/QuestionInfoMapper.java

@@ -19,4 +19,6 @@ public interface QuestionInfoMapper extends BaseMapper<QuestionInfo> {
     public void deleteByIds(Map map);
 
     public List<QuestionInfo> index(Map map);
+
+
 }

+ 11 - 0
icssman-service/src/main/java/com/diagbot/service/DeptInfoService.java

@@ -2,9 +2,12 @@ package com.diagbot.service;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.diagbot.dto.DeptInfoDTO;
 import com.diagbot.entity.DeptInfo;
 import com.diagbot.vo.GetDeptInfoVO;
 
+import java.util.List;
+
 /**
  * <p>
  * 科室信息表 服务类
@@ -21,4 +24,12 @@ public interface DeptInfoService extends IService<DeptInfo> {
      * @return
      */
     public IPage<DeptInfo> getAllDeptInfo(GetDeptInfoVO getDeptInfoVO);
+
+    /**
+     *  获取科室信息
+     * @param deptCode
+     * @param hospitalCode
+     * @return
+     */
+    public List<DeptInfoDTO> getDeptInfos(String deptCode, String hospitalCode);
 }

+ 8 - 0
icssman-service/src/main/java/com/diagbot/service/impl/DeptInfoServiceImpl.java

@@ -2,12 +2,15 @@ package com.diagbot.service.impl;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.diagbot.dto.DeptInfoDTO;
 import com.diagbot.entity.DeptInfo;
 import com.diagbot.mapper.DeptInfoMapper;
 import com.diagbot.service.DeptInfoService;
 import com.diagbot.vo.GetDeptInfoVO;
 import org.springframework.stereotype.Service;
 
+import java.util.List;
+
 /**
  * <p>
  * 科室信息表 服务实现类
@@ -23,4 +26,9 @@ public class DeptInfoServiceImpl extends ServiceImpl<DeptInfoMapper, DeptInfo> i
     public IPage<DeptInfo> getAllDeptInfo(GetDeptInfoVO getDeptInfoVO) {
         return baseMapper.getAllDeptInfo(getDeptInfoVO);
     }
+
+    @Override
+    public List<DeptInfoDTO> getDeptInfos(String deptCode, String hospitalCode) {
+        return baseMapper.getDeptInfos(deptCode,hospitalCode);
+    }
 }

+ 2 - 3
icssman-service/src/main/java/com/diagbot/web/IntroduceDetailController.java

@@ -14,7 +14,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 
-import java.util.Arrays;
 import java.util.List;
 
 /**
@@ -48,7 +47,7 @@ public class IntroduceDetailController {
     @SysLogger("deleteRecord")
     @Transactional
     public RespDTO<Boolean> deleteRecord(@RequestParam Long id) {
-        Boolean data = introduceDetailFacade.removeById(id);
+        Boolean data = introduceDetailFacade.deleteRecord(id);
         return RespDTO.onSuc(data);
     }
 
@@ -58,7 +57,7 @@ public class IntroduceDetailController {
     @SysLogger("deleteRecords")
     @Transactional
     public RespDTO<Boolean> deleteRecords(@RequestParam Long[] ids) {
-        Boolean data = introduceDetailFacade.removeByIds(Arrays.asList(ids));
+        Boolean data = introduceDetailFacade.deleteRecords(ids);
         return RespDTO.onSuc(data);
     }
 }

+ 16 - 3
icssman-service/src/main/java/com/diagbot/web/QuestionUsualController.java

@@ -1,8 +1,10 @@
 package com.diagbot.web;
 
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.diagbot.annotation.SysLogger;
 import com.diagbot.dto.RespDTO;
+import com.diagbot.entity.QuestionUsual;
 import com.diagbot.facade.QuestionUsualFacade;
 import com.diagbot.vo.QuestionUsualVO;
 import com.diagbot.vo.UpdateQuetionUsualVO;
@@ -15,6 +17,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>
  * 常用标签表 前端控制器
@@ -39,7 +43,7 @@ public class QuestionUsualController {
     @PostMapping("/addQuestionUsual")
     @SysLogger("addQuestionUsual")
     @Transactional
-    public RespDTO<Boolean> addQuestionUsual(@RequestBody QuestionUsualVO questionUsualVO) {
+    public RespDTO<Boolean> addQuestionUsual(@Valid @RequestBody QuestionUsualVO questionUsualVO) {
         Boolean data = questionUsualFacade.addQuestionUsual(questionUsualVO);
         return RespDTO.onSuc(data);
     }
@@ -51,7 +55,7 @@ public class QuestionUsualController {
     @PostMapping("/updateQuestionUsual")
     @SysLogger("updateQuestionUsual")
     @Transactional
-    public RespDTO<Boolean> updateQuestionUsual(@RequestBody UpdateQuetionUsualVO updateQuetionUsualVO) {
+    public RespDTO<Boolean> updateQuestionUsual(@Valid @RequestBody UpdateQuetionUsualVO updateQuetionUsualVO) {
         Boolean data = questionUsualFacade.updateQuestionUsual(updateQuetionUsualVO);
         return RespDTO.onSuc(data);
     }
@@ -61,8 +65,17 @@ public class QuestionUsualController {
     @PostMapping("/deleteQuestionUsual")
     @SysLogger("deleteQuestionUsual")
     @Transactional
-    public RespDTO<Boolean> deleteQuestionUsual(@RequestBody UpdateQuetionUsualVO updateQuetionUsualVO) {
+    public RespDTO<Boolean> deleteQuestionUsual(@Valid @RequestBody UpdateQuetionUsualVO updateQuetionUsualVO) {
         Boolean data = questionUsualFacade.deleteQuestionUsual(updateQuetionUsualVO);
         return RespDTO.onSuc(data);
     }
+
+    @ApiOperation(value = "常用标签维护——查询[by:wangyu]",
+            notes = "id: 常用标签id,必填<br>")
+    @PostMapping("/getQuestionUsual")
+    @SysLogger("getQuestionUsual")
+    public RespDTO<IPage<QuestionUsual>> getQuestionUsual() {
+        IPage<QuestionUsual> data = questionUsualFacade.getQuestionUsual();
+        return RespDTO.onSuc(data);
+    }
 }

+ 2 - 2
icssman-service/src/main/java/com/diagbot/web/RetrievalController.java

@@ -28,8 +28,8 @@ import io.swagger.annotations.ApiOperation;
  * 同义词检索表 前端控制器
  * </p>
  *
- * @author wangyu
- * @since 2018--03
+ * @author rgb
+ * @since 2018--12
  */
 @RestController
 @RequestMapping("/retrieval")

+ 7 - 0
icssman-service/src/main/resources/mapper/DeptInfoMapper.xml

@@ -21,4 +21,11 @@
          </if>
         order by id desc
     </select>
+
+    <select id="getDeptInfos" resultType="com.diagbot.dto.DeptInfoDTO">
+        SELECT a.* FROM `icss_dept_info` a
+        LEFT JOIN tran_hospital_dept b ON a.id = b.dept_id
+        WHERE a.is_deleted = 'N' AND b.is_deleted = 'N'
+        AND b.`code` = #{deptCode} AND b.hospital_code = #{hospitalCode}
+    </select>
 </mapper>

+ 1 - 0
user-service/src/main/java/com/diagbot/config/ResourceServerConfigurer.java

@@ -45,6 +45,7 @@ public class ResourceServerConfigurer extends ResourceServerConfigurerAdapter {
                 .antMatchers("/userAuthentication/getAuthInfoCount").permitAll()
                 .antMatchers("/user/getUserAllInfo").permitAll()
                 .antMatchers("/user/verifyToken").permitAll()
+                .antMatchers("/user/getUserInfoByIds").permitAll()
                 .antMatchers("/**").authenticated();
         //        .antMatchers("/**").permitAll();
     }

+ 1 - 0
user-service/src/main/java/com/diagbot/config/security/UrlAccessDecisionManager.java

@@ -105,6 +105,7 @@ public class UrlAccessDecisionManager implements AccessDecisionManager {
                 || matchers("/userAuthentication/getAuthInfoCount", request)
                 || matchers("/user/getUserAllInfo", request)
                 || matchers("/user/verifyToken", request)
+                || matchers("/user/getUserInfoByIds", request)
                 || matchers("/", request)) {
             return true;
         }

+ 49 - 28
user-service/src/main/java/com/diagbot/facade/UserFacade.java

@@ -43,7 +43,6 @@ import com.diagbot.exception.CommonErrorCode;
 import com.diagbot.exception.CommonException;
 import com.diagbot.exception.ServiceErrorCode;
 import com.diagbot.idc.VisibleIdCreater;
-import com.diagbot.service.TokenService;
 import com.diagbot.service.impl.UserServiceImpl;
 import com.diagbot.util.BeanUtil;
 import com.diagbot.util.DateUtil;
@@ -819,8 +818,8 @@ public class UserFacade extends UserServiceImpl {
         auditMap.put("gmtModified", DateUtil.now());
         auditMap.put("certificationDate", DateUtil.now());
         User userDate = getById(userInfoAuditVO.getUserId());
-        if(!userDate.getAuthStatus().equals(2)){
-       	 return RespDTO.onError("该用户已被操作"); 
+        if (!userDate.getAuthStatus().equals(2)) {
+            return RespDTO.onError("该用户已被操作");
         }
         if (ByType == 1) {
             auditMap.put("isReject", RejectEnum.PASS.getKey());
@@ -904,7 +903,7 @@ public class UserFacade extends UserServiceImpl {
         User user = new User();
         user.setCreator(UserUtils.getCurrentPrincipleID());//创建id
         user.setUsername(userAndOrganizationVO.getUserName());//用户账号
-        String password= DigestUtils.md5Hex(userAndOrganizationVO.getPassWord());
+        String password = DigestUtils.md5Hex(userAndOrganizationVO.getPassWord());
         //System.out.println(password);
         PasswordEncoder passwordEncoder = PasswordEncoderFactories.createDelegatingPasswordEncoder();
         String entryPassword = passwordEncoder.encode(password);
@@ -960,10 +959,10 @@ public class UserFacade extends UserServiceImpl {
         map.put("userId", baseIdVO.getId());
         map.put("modifier", UserUtils.getCurrentPrincipleID());
         map.put("gmtModified", DateUtil.now());
-         User userDate = getById(baseIdVO.getId());
-         if(userDate.getIsDeleted().equals("Y")){
-        	 return RespDTO.onError("该用户已不存在"); 
-         }
+        User userDate = getById(baseIdVO.getId());
+        if (userDate.getIsDeleted().equals("Y")) {
+            return RespDTO.onError("该用户已不存在");
+        }
         //客户中心-查询用户续费数量
         RespDTO<Integer> renewalSums = diagbotmanClient.getUserWaitingRenewal(baseIdVO.getId());
         if (renewalSums == null || !"0".equals(renewalSums.code)) {
@@ -972,9 +971,9 @@ public class UserFacade extends UserServiceImpl {
         }
         int renewalSum = renewalSums.data;
         //System.out.println("========renewalSu====="+renewalSum);
-        if(renewalSum>0){
-   		 return RespDTO.onError("该用户无法删除,请先处理产品申请信息");
-      	}
+        if (renewalSum > 0) {
+            return RespDTO.onError("该用户无法删除,请先处理产品申请信息");
+        }
         //查询用户是否有待审核的产品数量
         RespDTO<Integer> auditSums = diagbotmanClient.getOrderByUserToAudit(baseIdVO.getId());
         if (auditSums == null || !"0".equals(auditSums.code)) {
@@ -983,25 +982,25 @@ public class UserFacade extends UserServiceImpl {
         }
         int auditSum = auditSums.data;
         //System.out.println("=========auditSumauditSum===="+auditSum);
-        if(auditSum>0){
-   		 return RespDTO.onError("该用户存在产品申请单,请先审核");
-    	}
+        if (auditSum > 0) {
+            return RespDTO.onError("该用户存在产品申请单,请先审核");
+        }
         List<Long> userIds = new ArrayList<>();
         userIds.add(baseIdVO.getId());
         RespDTO<List<UserAndProdutDTO>> InformationData = diagbotmanClient.getInformationAvailableAll(userIds);
-        
-            if (InformationData == null || !"0".equals(InformationData.code)) {
-                throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
-                        "获取所有开通信息失败");
-            }
-            //获取该用户开通的产品信息的状态
-            List<UserAndProdutDTO> dataList = InformationData.data;
-            for(UserAndProdutDTO InformationDataNew :dataList){
-            	Integer serviceStatus =InformationDataNew.getServiceStatus();
-            	if(serviceStatus.equals(StatusEnum.Enable.getKey())){
-            		 return RespDTO.onError("请先停用所有产品");
-            	}
+
+        if (InformationData == null || !"0".equals(InformationData.code)) {
+            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
+                    "获取所有开通信息失败");
+        }
+        //获取该用户开通的产品信息的状态
+        List<UserAndProdutDTO> dataList = InformationData.data;
+        for (UserAndProdutDTO InformationDataNew : dataList) {
+            Integer serviceStatus = InformationDataNew.getServiceStatus();
+            if (serviceStatus.equals(StatusEnum.Enable.getKey())) {
+                return RespDTO.onError("请先停用所有产品");
             }
+        }
         boolean res = updateDeleted(map);
         if (!res) {
             throw new CommonException(CommonErrorCode.UPDATE_INFO_FAIL);
@@ -1403,8 +1402,8 @@ public class UserFacade extends UserServiceImpl {
         amendUserInfo.put("position", amendUserInfoVO.getPosition());
         amendUserInfo.put("linkman", amendUserInfoVO.getLinkman());
         User userDate = getById(amendUserInfoVO.getUserId());
-        if(userDate.getIsDeleted().equals("Y")){
-       	 return RespDTO.onError("该用户已不存在"); 
+        if (userDate.getIsDeleted().equals("Y")) {
+            return RespDTO.onError("该用户已不存在");
         }
         boolean res = updateUserInfo(amendUserInfo);
         if (!res) {
@@ -1433,4 +1432,26 @@ public class UserFacade extends UserServiceImpl {
         return RespDTO.onSuc(this.getById(userId));
     }
 
+    /**
+     * 根据用户ID列表获取用户数据
+     *
+     * @param ids 用户ID列表
+     * @return 用户名信息列表
+     */
+    public Map<String, String> getUserInfoByIds(List<String> ids) {
+        List<Long> longList = new ArrayList<>();
+        for (String id : ids){
+            if(!longList.contains(id)){
+                longList.add(Long.valueOf(id));
+            }
+        }
+        List<User> userList = this.getByIds(longList);
+        Map<String, String> map = new HashMap<>();
+        if (ListUtil.isNotEmpty(userList)){
+            for (User user: userList){
+                map.put(user.getId().toString(), user.getUsername());
+            }
+        }
+        return map;
+    }
 }

+ 8 - 0
user-service/src/main/java/com/diagbot/web/UserController.java

@@ -347,4 +347,12 @@ public class UserController {
     public RespDTO<GetConsoleUserInfoDTO> getConsoleUserInfo() {
         return RespDTO.onSuc(userFacade.getConsoleUserInfo());
     }
+
+    @ApiOperation(value = "根据用户ID列表获取用户数据(远程调用)[by:gaodm]", notes = "根据用户ID列表获取用户数据")
+    @PostMapping("/getUserInfoByIds")
+    @SysLogger("getUserInfoByIds")
+//    @ApiIgnore
+    public RespDTO<Map<String, String>> getUserInfoByIds(@RequestBody List<String> ids){
+        return RespDTO.onSuc(userFacade.getUserInfoByIds(ids));
+    }
 }