Selaa lähdekoodia

七院医生信息定时更改,病案首页反差医生id更改

shiyue 3 vuotta sitten
vanhempi
commit
4188d996fb

+ 9 - 4
src/main/java/com/diagbot/facade/data/ABasDoctorInfoFacade.java

@@ -2,6 +2,7 @@ package com.diagbot.facade.data;
 
 import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.dto.data.ABasDoctorInfoDTO;
 import com.diagbot.entity.BasDoctorInfo;
@@ -37,9 +38,9 @@ public class ABasDoctorInfoFacade extends BasDoctorInfoServiceImpl {
             String sql="select * from v_gy_zgxx_ys";
             List<BasDoctorInfo> basDeptInfoList = tzDBConn.getBasDoctorInfo(sql);
             execute(basDeptInfoList);
-            aMedAbnormalInfoFacade.saveAbnormalInfo("医生信息更新","",JSON.toJSONString(basDeptInfoList), "", "");
+            aMedAbnormalInfoFacade.saveAbnormalInfo("医生信息更新成功","",JSON.toJSONString(basDeptInfoList), "", "");
         }catch (Exception e){
-
+            aMedAbnormalInfoFacade.saveAbnormalInfo("医生信息更新失败","","", "", e.getMessage());
         }
 
 
@@ -97,10 +98,14 @@ public class ABasDoctorInfoFacade extends BasDoctorInfoServiceImpl {
                     .eq("hospital_id", s.getHospitalId()));
             if (basDoctorInfo != null) {
                 s.setGmtModified(new Date());
-                updateE.add(s);
+//                updateE.add(s);
+                QueryWrapper<BasDoctorInfo> updateWrapper = Wrappers.query();
+                updateWrapper.eq("doctor_id",s.getDoctorId());
+                this.update(s,updateWrapper);
             } else {
                 s.setGmtCreate(new Date());
-                addE.add(s);
+                this.save(s);
+//                addE.add(s);
             }
         });
         if(updateE.size()>0){

+ 2 - 2
src/main/java/com/diagbot/facade/data/AHomePageFacade.java

@@ -142,7 +142,7 @@ public class AHomePageFacade extends HomePageServiceImpl{
      * 更新数据到数据库
      * @param aHomePageIngVO
      */
-    private void updateHomePageIng(AHomePageIngVO aHomePageIngVO){
+    public void updateHomePageIng(AHomePageIngVO aHomePageIngVO){
         try {
             List<HomePage> homePageList=Lists.newArrayList();
             aHomePageIngVO.getHomePages().stream().forEach(s->{
@@ -208,7 +208,7 @@ public class AHomePageFacade extends HomePageServiceImpl{
      */
     public String getDoctorId(String doctorName){
         QueryWrapper<BasDoctorInfo> queryWrapper = Wrappers.query();
-        queryWrapper.eq("",doctorName);
+        queryWrapper.eq("name",doctorName);
         BasDoctorInfo doctorInfo =aBasDoctorInfoFacade.getOne(queryWrapper);
         if (doctorInfo !=null && StringUtils.isNotEmpty(doctorInfo.getDoctorId())){
             return doctorInfo.getDoctorId();

+ 18 - 0
src/main/java/com/diagbot/facade/data/AMedAbnormalInfoFacade.java

@@ -1,13 +1,20 @@
 package com.diagbot.facade.data;
 
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.diagbot.entity.MedAbnormalInfo;
 import com.diagbot.service.impl.MedAbnormalInfoServiceImpl;
+import com.diagbot.vo.data.AHomePageIngVO;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
 import java.util.Date;
+import java.util.List;
 
 @Component
 public class AMedAbnormalInfoFacade extends MedAbnormalInfoServiceImpl {
+    @Autowired
+    private AHomePageFacade aHomePageFacade;
     /**
      * 接口日志记录
      *
@@ -25,4 +32,15 @@ public class AMedAbnormalInfoFacade extends MedAbnormalInfoServiceImpl {
         medAbnormalInfo.setGmtCreate(new Date());
         this.save(medAbnormalInfo);
     }
+
+    public void a(String name){
+        QueryWrapper<MedAbnormalInfo> wrapper =new QueryWrapper<>();
+        wrapper.eq("module_name",name);
+        List<MedAbnormalInfo> medAbnormalInfo =this.list(wrapper);
+        medAbnormalInfo.forEach(s->{
+            AHomePageIngVO aHomePageIngVO = JSON.parseObject(s.getParamIn(),AHomePageIngVO.class);
+            aHomePageFacade.updateHomePageIng(aHomePageIngVO);
+        });
+
+    }
 }

+ 0 - 1
src/main/java/com/diagbot/util/TZDBConn.java

@@ -121,7 +121,6 @@ public class TZDBConn {
 				basDoctorInfo.setName(rs.getString("XM"));//医生姓名
 				basDoctorInfo.setProfessor(rs.getString("MC"));//职称
 				basDoctorInfo.setGroupId(rs.getString("YSZH"));//医疗组id
-
 				basDoctorInfoList.add(basDoctorInfo);
 			}
 		} catch (Exception e) {

+ 18 - 13
src/main/java/com/diagbot/web/DataController.java

@@ -55,6 +55,10 @@ public class DataController {
     private SendDataDealFacade sendDataDealFacade;
     @Autowired
     private OldDataFacade oldDataFacade;
+    @Autowired
+    private AMedAbnormalInfoFacade aMedAbnormalInfoFacade;
+
+
 
 //    @ApiOperation(value = "数据引擎-获取医院所有在职医生的基本信息")
 //    @PostMapping("/sendDoctorInfos")
@@ -250,21 +254,22 @@ public class DataController {
         oldDataFacade.execute();
     }
 
-    /*
-    @ApiOperation(value = "数据引擎-列字段名和注释")
+
+    @ApiOperation(value = "测试")
     @PostMapping("/getColumnZhAndCh")
     @SysLogger("getColumnZhAndCh")
-    public RespDTO getColumnZhAndCh(){
-        aStrConsultationNoteFacade.getColumnZhAndCh();
+    public RespDTO getColumnZhAndCh(String name){
+        aMedAbnormalInfoFacade.a(name);
         return RespDTO.onSuc(true);
     }
-    @Autowired
-    private ColumnFacade columnFacade;
-    @ApiOperation(value = "病历解析")
-    @PostMapping("/analyseRec")
-    @SysLogger("analyseRec")
-    public RespDTO analyseRec(@RequestBody AColumnVO aColumnVO){
-        columnFacade.analyseRec(aColumnVO.getHospitalId(),aColumnVO.getModeId(),aColumnVO.getContent());
-        return RespDTO.onSuc(true);
-    }*/
+
+//    @Autowired
+//    private ColumnFacade columnFacade;
+//    @ApiOperation(value = "病历解析")
+//    @PostMapping("/analyseRec")
+//    @SysLogger("analyseRec")
+//    public RespDTO analyseRec(@RequestBody AColumnVO aColumnVO){
+//        columnFacade.analyseRec(aColumnVO.getHospitalId(),aColumnVO.getModeId(),aColumnVO.getContent());
+//        return RespDTO.onSuc(true);
+//    }
 }

+ 4 - 3
src/main/resources/mapper/BasDoctorInfoMapper.xml

@@ -25,12 +25,13 @@
                     name = #{item.name},
                     professor = #{item.professor},
                     occup = #{item.occup},
+                    group_id = #{item.groupId}
+                <if test="item.gmtCreate != null">
+                    gmt_create = #{item.gmtCreate},
+                </if>
                 <if test="item.gmtModified != null">
                     gmt_modified = #{item.gmtModified},
                 </if>
-                <if test="item.modifier != null">
-                    modifier = #{item.modifier},
-                </if>
             </set>
             where doctor_id = #{item.doctorId} and hospital_id = #{item.hospitalId}
         </foreach>