Sfoglia il codice sorgente

三级医生设置

xiaochan 2 anni fa
parent
commit
27baf2390d

+ 6 - 0
src/main/java/thyyxxk/webserver/controller/PublicController.java

@@ -11,6 +11,7 @@ import thyyxxk.webserver.config.auth.PassToken;
 import thyyxxk.webserver.entity.ResultVo;
 import thyyxxk.webserver.entity.datamodify.GetDropdownBox;
 import thyyxxk.webserver.entity.login.UserInfo;
+import thyyxxk.webserver.entity.login.UserInfoSelect;
 import thyyxxk.webserver.entity.publicapi.ZkList;
 import thyyxxk.webserver.entity.zhuyuanyisheng.PatientAllergenInfo;
 import thyyxxk.webserver.service.PublicServer;
@@ -218,5 +219,10 @@ public class PublicController {
         return service.getUserInfoByCode(code);
     }
 
+    @GetMapping("/getPersonnelAll")
+    public ResultVo<List<UserInfoSelect>> getPersonnelAll() {
+        return service.getPersonnelAll();
+    }
+
 
 }

+ 27 - 0
src/main/java/thyyxxk/webserver/controller/zhuyuanyizheng/Level3DoctorSetupController.java

@@ -0,0 +1,27 @@
+package thyyxxk.webserver.controller.zhuyuanyizheng;
+
+import org.springframework.web.bind.annotation.*;
+import thyyxxk.webserver.entity.ResultVo;
+import thyyxxk.webserver.entity.inpatient.patient.Overview;
+import thyyxxk.webserver.entity.login.UserInfoSelect;
+import thyyxxk.webserver.service.zhuyuanyisheng.Level3DoctorSetupService;
+
+import java.util.List;
+
+@RestController
+@RequestMapping("/Level3DoctorSetup")
+public class Level3DoctorSetupController {
+
+    private final Level3DoctorSetupService service;
+
+    public Level3DoctorSetupController(Level3DoctorSetupService service) {
+        this.service = service;
+    }
+
+    @PostMapping("/updateDoctor")
+    public ResultVo<String> updateDoctor(@RequestBody List<Overview> userInfoSelects) {
+        return service.updateDoctor(userInfoSelects);
+    }
+
+
+}

+ 13 - 0
src/main/java/thyyxxk/webserver/dao/his/PublicDao.java

@@ -9,6 +9,7 @@ import thyyxxk.webserver.entity.datamodify.GetDropdownBox;
 import thyyxxk.webserver.entity.datamodify.ZyDetailCharge;
 import thyyxxk.webserver.entity.dictionary.CodeName;
 import thyyxxk.webserver.entity.login.UserInfo;
+import thyyxxk.webserver.entity.login.UserInfoSelect;
 import thyyxxk.webserver.entity.medicalinsurance.inpatient.ZyPatientInfo;
 import thyyxxk.webserver.entity.publicapi.ZkList;
 import thyyxxk.webserver.entity.socketmessage.SocketMessage;
@@ -375,4 +376,16 @@ public interface PublicDao {
                                    @Param("table") String table);
 
 
+    @Select("select code, " +
+            "       code_rs," +
+            "       rtrim(name) name, " +
+            "       dept_code, " +
+            "       dept_code_name = (select rtrim(name) from zd_unit_code where dept_code = zd_unit_code.code), " +
+            "       rtrim(py_code) py_code, " +
+            "       rtrim(d_code) d_code " +
+            "from a_employee_mi " +
+            "where isnull(del_flag, 0) = 0")
+    List<UserInfoSelect> getPersonnelAll();
+
+
 }

+ 15 - 7
src/main/java/thyyxxk/webserver/dao/his/inpatient/PatientDao.java

@@ -31,13 +31,21 @@ public interface PatientDao {
             "                      and c.admiss_times = a.admiss_times " +
             "                      and c.status_flag = '1' " +
             "                      and c.enter_oper = #{userCode}), " +
-            "                   refer_physician, " +
-            "                   (select name from a_employee_mi where code = refer_physician) as refer_physician_name, " +
-            "                   consult_physician, " +
-            "                   (select name from a_employee_mi where code = refer_physician) as consult_physician_name, " +
-            "                   dept_director, " +
-            "                   (select name from a_employee_mi where code = refer_physician) as dept_director_name " +
-            "from zy_actpatient a where a.ward like #{ward} ${sql} " +
+            "                   rtrim(refer_physician) refer_physician, " +
+            "                   (select rtrim(name) from a_employee_mi where code = refer_physician) as refer_physician_name, " +
+            "                   rtrim(consult_physician) consult_physician, " +
+            "                   (select rtrim(name) from a_employee_mi where code = consult_physician) as consult_physician_name, " +
+            "                   rtrim(dept_director) dept_director, " +
+            "                   (select rtrim(name) from a_employee_mi where code = dept_director) as dept_director_name, " +
+            "                         total_charge, " +
+            "                         balance, " +
+            "                         rtrim(admiss_diag_str) as  admiss_diag_str, " +
+            "                         rtrim(clinic_diag_str) as  clinic_diag_str, " +
+            "   responce_type_name = (select rtrim(name) from zy_zd_responce_type where code = responce_type)," +
+            "   admiss_date,zkys," +
+            "   zkys_name =(select rtrim(name) from a_employee_mi where code = zkys) " +
+            "from zy_actpatient a left join batj_ba2 ba on (a.inpatient_no = ba.zyh and a.admiss_times = ba.zycs) " +
+            "where a.ward like #{ward} ${sql} " +
             "ORDER BY cast(a.bed_no AS int)")
     List<Overview> getOverView(@Param("ward") String ward,
                                @Param("userCode") String userCode,

+ 37 - 0
src/main/java/thyyxxk/webserver/dao/his/zhuyuanyisheng/Level3DoctorSetupDao.java

@@ -0,0 +1,37 @@
+package thyyxxk.webserver.dao.his.zhuyuanyisheng;
+
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Update;
+import thyyxxk.webserver.entity.inpatient.patient.Overview;
+import thyyxxk.webserver.entity.login.UserInfoSelect;
+
+import java.util.List;
+
+@Mapper
+public interface Level3DoctorSetupDao {
+
+    @Update("<script>" +
+            "<foreach collection='list' item='item' separator=';'>" +
+            "update zy_actpatient " +
+            "set refer_physician   = #{item.referPhysician}, " +
+            "    consult_physician = #{item.consultPhysician}, " +
+            "    dept_director     = #{item.deptDirector} " +
+            "where inpatient_no = #{item.inpatientNo} " +
+            "  and admiss_times = #{item.admissTimes} " +
+            "</foreach>" +
+            "</script>")
+    void updateDoctor(@Param("list") List<Overview> userInfoSelects);
+
+
+    @Update("<script>" +
+            "<foreach collection='list' item='item' separator=';'>" +
+            "update batj_ba2 " +
+            "set zkys = #{item.zkys} " +
+            "where zyh = #{item.inpatientNo} " +
+            "  and zycs = #{item.inpatientNo} " +
+            "</foreach>" +
+            "</script>")
+    void updateZkys(@Param("list") List<Overview> userInfoSelects);
+
+}

+ 2 - 2
src/main/java/thyyxxk/webserver/dao/his/zhuyuanyisheng/YiZhuLuRuDao.java

@@ -1423,8 +1423,8 @@ public interface YiZhuLuRuDao {
 
     @Update("update yz_act_order " +
             "set modifier           = #{userCode}, " +
-            "    end_time           = '', " +
-            "    exclu_act_order_no = '' " +
+            "    end_time           = #{param.date}, " +
+            "    exclu_act_order_no = #{param.orderNo} " +
             "where inpatient_no = #{param.patNo} " +
             "  and admiss_times = #{param.times} " +
             "  and status_flag in ('3', '4') " +

+ 26 - 0
src/main/java/thyyxxk/webserver/entity/inpatient/patient/Overview.java

@@ -3,6 +3,7 @@ package thyyxxk.webserver.entity.inpatient.patient;
 import lombok.Data;
 import thyyxxk.webserver.utils.StringUtil;
 
+import java.math.BigDecimal;
 import java.util.Date;
 
 /**
@@ -52,6 +53,31 @@ public class Overview {
     private String deptDirector;
     private String deptDirectorName;
 
+    /**
+     * 总费用
+     */
+    private BigDecimal totalCharge;
+    /**
+     * 余额
+     */
+    private BigDecimal balance;
+    /**
+     * 入院诊断
+     */
+    private String admissDiagStr;
+    /**
+     * 临床诊断
+     */
+    private String clinicDiagStr;
+    /**
+     * 医保身份
+     */
+    private String responceTypeName;
+
+    private Date admissDate;
+
+    private String zkys;
+    private String zkysName;
 
     public Integer getStatus() {
         if (StringUtil.notBlank(mdtrtId) || StringUtil.notBlank(injurySerialNo)) {

+ 22 - 0
src/main/java/thyyxxk/webserver/entity/login/UserInfoSelect.java

@@ -0,0 +1,22 @@
+package thyyxxk.webserver.entity.login;
+
+import lombok.Data;
+
+@Data
+public class UserInfoSelect {
+    private String code;
+    private String codeRs;
+    private String name;
+    private String pyCode;
+    private String dCode;
+    private String deptCode;
+    private String deptCodeName;
+
+    public String getLabel() {
+        return name;
+    }
+
+    public String getValue() {
+        return code;
+    }
+}

+ 19 - 12
src/main/java/thyyxxk/webserver/service/PublicServer.java

@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.dynamic.datasource.annotation.DS;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.sun.org.apache.regexp.internal.RE;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.collections4.ListUtils;
 import org.jetbrains.annotations.NotNull;
@@ -28,6 +29,7 @@ import thyyxxk.webserver.entity.datamodify.ZyDetailCharge;
 import thyyxxk.webserver.entity.dictionary.CodeName;
 import thyyxxk.webserver.entity.inpatient.ZyActpatient;
 import thyyxxk.webserver.entity.login.UserInfo;
+import thyyxxk.webserver.entity.login.UserInfoSelect;
 import thyyxxk.webserver.entity.medicalinsurance.inpatient.ZyPatientInfo;
 import thyyxxk.webserver.entity.publicapi.ZkList;
 import thyyxxk.webserver.entity.settings.notification.SendMessageParam;
@@ -360,6 +362,23 @@ public class PublicServer {
         return ResultVoUtil.success(dao.getRenYuan(StringUtil.isContainChinese(code), deptCode));
     }
 
+    /**
+     * 获取员工信息
+     *
+     * @param code 编码
+     * @return 返回
+     */
+    public UserInfo huoQuYuanGongXinXi(String code) {
+        if (StringUtil.isBlank(code)) {
+            return new UserInfo();
+        }
+        return dao.huoQuYuanGongBianMa(code);
+    }
+
+    public ResultVo<List<UserInfoSelect>> getPersonnelAll() {
+        return ResultVoUtil.success(dao.getPersonnelAll());
+    }
+
     /**
      * 搜索项目信息
      *
@@ -455,18 +474,6 @@ public class PublicServer {
         }
     }
 
-    /**
-     * 获取员工信息
-     *
-     * @param code 编码
-     * @return 返回
-     */
-    public UserInfo huoQuYuanGongXinXi(String code) {
-        if (StringUtil.isBlank(code)) {
-            return new UserInfo();
-        }
-        return dao.huoQuYuanGongBianMa(code);
-    }
 
     public List<String> huoQuBingFangDeKeShi(String deptCode) {
         if (getRoleCode().getData().contains(1) || getRoleCode().getData().contains(8) || StringUtil.isBlank(deptCode)) {

+ 0 - 4
src/main/java/thyyxxk/webserver/service/zhuyuanyisheng/Level3DoctorSetting.java

@@ -1,4 +0,0 @@
-package thyyxxk.webserver.service.zhuyuanyisheng;
-
-public class Level3DoctorSetting {
-}

+ 46 - 0
src/main/java/thyyxxk/webserver/service/zhuyuanyisheng/Level3DoctorSetupService.java

@@ -0,0 +1,46 @@
+package thyyxxk.webserver.service.zhuyuanyisheng;
+
+import cn.hutool.core.collection.ListUtil;
+import org.springframework.stereotype.Service;
+import thyyxxk.webserver.config.exception.ExceptionEnum;
+import thyyxxk.webserver.dao.his.casefrontsheet.CaseFrontSheetDao;
+import thyyxxk.webserver.dao.his.zhuyuanyisheng.Level3DoctorSetupDao;
+import thyyxxk.webserver.entity.ResultVo;
+import thyyxxk.webserver.entity.inpatient.patient.Overview;
+import thyyxxk.webserver.utils.ResultVoUtil;
+
+import java.util.List;
+
+@Service
+public class Level3DoctorSetupService {
+
+    private final Level3DoctorSetupDao dao;
+
+    private final CaseFrontSheetDao caseFrontSheetDao;
+
+    public Level3DoctorSetupService(Level3DoctorSetupDao dao, CaseFrontSheetDao caseFrontSheetDao) {
+        this.dao = dao;
+        this.caseFrontSheetDao = caseFrontSheetDao;
+    }
+
+    public ResultVo<String> updateDoctor(List<Overview> userInfoSelects) {
+        List<List<Overview>> list = ListUtil.split(userInfoSelects, 50);
+
+        for (List<Overview> item : list) {
+            dao.updateDoctor(item);
+            for (Overview overview : item) {
+                try {
+                    if (caseFrontSheetDao.isBatjBa2Exist(overview.getInpatientNo(), overview.getAdmissTimes()) == 0) {
+                        caseFrontSheetDao.createBatjBa2(overview.getInpatientNo(), overview.getAdmissTimes());
+                    }
+                } catch (Exception ignored) {
+                }
+            }
+            dao.updateZkys(item);
+        }
+
+        return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_NOTIFICATION, "设置成功。");
+    }
+
+
+}

+ 3 - 0
src/main/java/thyyxxk/webserver/service/zhuyuanyisheng/YiZhuLuRuServer.java

@@ -1354,6 +1354,9 @@ public class YiZhuLuRuServer {
     }
 
     public ResultVo<String> oneClickStopOrder(OneClickOrder param) {
+        if (1 == 1) {
+            return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "该功能在测试阶段");
+        }
         param.setOrderNo(publicServer.getActOrderNo());
         param.setNowDate(new Date());
         param.setUserCode(TokenUtil.getTokenUserId());