Quellcode durchsuchen

病案首页。

xiaochan vor 4 Jahren
Ursprung
Commit
455c520dac

+ 3 - 1
src/main/java/thyyxxk/webserver/dao/his/casefrontsheet/BasSelectOverviewDao.java

@@ -1,14 +1,16 @@
 package thyyxxk.webserver.dao.his.casefrontsheet;
 
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Select;
+import thyyxxk.webserver.entity.casefrontsheet.CaseFrontsheetSurgery;
 import thyyxxk.webserver.entity.casefrontsheet.GetOutSheetParam;
 import thyyxxk.webserver.entity.casefrontsheet.SheetOverview;
 
 import java.util.List;
 
 @Mapper
-public interface BasSelectOverviewDao {
+public interface BasSelectOverviewDao extends BaseMapper<CaseFrontsheetSurgery> {
     @Select("select " +
             "signDate=(convert(varchar(10), b.sign_date, 21)), " +
             "bedNo=rtrim(a.bed_no), " +

+ 7 - 1
src/main/java/thyyxxk/webserver/dao/his/casefrontsheet/CaseFrontSheetDao.java

@@ -1,5 +1,6 @@
 package thyyxxk.webserver.dao.his.casefrontsheet;
 
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.apache.ibatis.annotations.*;
 import thyyxxk.webserver.entity.casefrontsheet.*;
 
@@ -10,7 +11,7 @@ import java.util.List;
  * @author dj
  */
 @Mapper
-public interface CaseFrontSheetDao {
+public interface CaseFrontSheetDao extends BaseMapper<CaseFrontsheetMain> {
     @Select("select " +
             "bedNo=rtrim(bed_no)," +
             "bah=rtrim(inpatient_no)," +
@@ -696,4 +697,9 @@ public interface CaseFrontSheetDao {
             "d.zycs=a.admiss_times and " +
             "d.ssbm like #{surgeryCode}")
     List<SheetOverview> advanceSearchWithSurgery(AdvanceSearchParam param);
+
+
+    @Select("select count(1) from t_case_frontsheet_main where bah=#{bah} and admiss_times=#{admissTimes}")
+    Integer bingAnQianShouZhuangTai(@Param("bah")String bah,
+                                    @Param("admissTimes")Integer admissTimes);
 }

+ 3 - 1
src/main/java/thyyxxk/webserver/dao/his/casefrontsheet/SheetCreatedDao.java

@@ -1,14 +1,16 @@
 package thyyxxk.webserver.dao.his.casefrontsheet;
 
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
+import thyyxxk.webserver.entity.casefrontsheet.CaseFrontsheetDisdiag;
 import thyyxxk.webserver.entity.dictionary.PureCodeName;
 
 import java.util.List;
 
 @Mapper
-public interface SheetCreatedDao {
+public interface SheetCreatedDao extends BaseMapper<CaseFrontsheetDisdiag> {
 
     @Select("SELECT DISTINCT " +
             "name=(SELECT rtrim(name) FROM zd_unit_code WHERE code=a.dept), " +

+ 4 - 0
src/main/java/thyyxxk/webserver/entity/casefrontsheet/CaseFrontsheetDisdiag.java

@@ -1,12 +1,16 @@
 package thyyxxk.webserver.entity.casefrontsheet;
 
 import java.io.Serializable;
+
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
 import lombok.Data;
 
 /**
  * @author dj
  */
 @Data
+@TableName(value = "t_case_frontsheet_disdiag")
 public class CaseFrontsheetDisdiag implements Serializable {
 
 	private static final long serialVersionUID =  3243613220628792569L;

+ 3 - 1
src/main/java/thyyxxk/webserver/entity/casefrontsheet/CaseFrontsheetMain.java

@@ -3,6 +3,8 @@ package thyyxxk.webserver.entity.casefrontsheet;
 import java.io.Serializable;
 
 import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
 import org.springframework.format.annotation.DateTimeFormat;
@@ -17,6 +19,7 @@ import java.util.List;
  * @author dj
  */
 @Data
+@TableName(value = "t_case_frontsheet_main")
 public class CaseFrontsheetMain implements Serializable {
 
 	private static final long serialVersionUID =  3870281948419892424L;
@@ -821,7 +824,6 @@ public class CaseFrontsheetMain implements Serializable {
 	@TableField(exist = false)
 	private List<CaseFrontsheetDisdiag> disdiagList;
 
-
 	/**
 	 * 手术列表
 	 * */

+ 3 - 0
src/main/java/thyyxxk/webserver/entity/casefrontsheet/CaseFrontsheetSurgery.java

@@ -3,6 +3,8 @@ package thyyxxk.webserver.entity.casefrontsheet;
 import java.io.Serializable;
 
 import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
 import lombok.Data;
 import thyyxxk.webserver.utils.StringUtil;
 
@@ -12,6 +14,7 @@ import java.util.Date;
  * @author dj
  */
 @Data
+@TableName(value = "t_case_frontsheet_surgery")
 public class CaseFrontsheetSurgery implements Serializable {
 
 	private static final long serialVersionUID =  7108736575632532984L;

+ 27 - 7
src/main/java/thyyxxk/webserver/service/casefrontsheet/CaseFrontSheetService.java

@@ -14,7 +14,6 @@ import thyyxxk.webserver.entity.ResultVo;
 import thyyxxk.webserver.entity.casefrontsheet.*;
 import thyyxxk.webserver.entity.dictionary.PureCodeName;
 import thyyxxk.webserver.utils.*;
-
 import java.lang.reflect.Field;
 import java.sql.Connection;
 import java.sql.DriverManager;
@@ -25,7 +24,6 @@ import java.util.concurrent.ConcurrentHashMap;
 
 @Slf4j
 @Service
-@DS("dev")
 public class CaseFrontSheetService {
     private static ConcurrentHashMap<String, List<PureCodeName>> allDictionary;
     private final CaseFrontSheetDao dao;
@@ -313,7 +311,7 @@ public class CaseFrontSheetService {
             return ResultVoUtil.success("保存成功。");
         } else {
             log.info("签收病案首页, 操作员:{} >>> 住院号:{}, 住院次数:{}", param.getStaffId(), bah, times);
-            if (true) { //userDao.getUserRoles(TokenUtil.getTokenUserId()).contains(7)
+            if (userDao.getUserRoles(TokenUtil.getTokenUserId()).contains(7)) {
                 if (isLateSubmit(sheet.getDismissDate()) > 8) {
                     sheet.setLateFlag(1);
                 } else {
@@ -322,12 +320,34 @@ public class CaseFrontSheetService {
                 dao.updateZyFileStatus(1, bah, times);
                 dao.updateZyInFileStatus(1, bah, times);
                 dao.updateLateSubmitFlag(sheet.getLateFlag(), bah, times);
-                //签收成功后需要保存到表中
-                System.out.println(param);
-                System.out.println(param.getSheet());
+                //插入数据 SignDate 签收日期  在点击签收后 向数据库中插入
+                sheet.setSignDate(new Date());
+                sheet.setFileStatus(1);
+                //判断是否已经插入过了
+                if (dao.bingAnQianShouZhuangTai(sheet.getBah(),sheet.getAdmissTimes()) == 0){
+                    //在t_case_frontsheet_main表中插入 主体的内容
+                    dao.insert(sheet);
+                    //循环插主要的诊断
+                    for (CaseFrontsheetDisdiag caseFrontsheetDisdiag : sheet.getDisdiagList()) {
+                        caseFrontsheetDisdiag.setBah(sheet.getBah());
+                        caseFrontsheetDisdiag.setTimes(sheet.getAdmissTimes());
+                        if (caseFrontsheetDisdiag.getNo()!=null){
+                            createdDao.insert(caseFrontsheetDisdiag);
+                        }
+                    }
+                    //循环插入做过的手术
+                    for (CaseFrontsheetSurgery caseFrontsheetSurgery : sheet.getSurgeryList()) {
+                        caseFrontsheetSurgery.setBah(sheet.getBah());
+                        caseFrontsheetSurgery.setTimes(sheet.getAdmissTimes());
+                        if (caseFrontsheetSurgery.getNo()!=null){
+                            basDao.insert(caseFrontsheetSurgery);
+                        }
+                    }
+                }else {
+                    return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "请勿重复签收 ( ˉ ⌓ ˉ ๑)");
+                }
                 return ResultVoUtil.success("签收成功。");
             } else {
-
                 return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "您没有签收首页的权限。");
             }
         }

+ 0 - 11
src/main/java/thyyxxk/webserver/service/datamodify/YzActOrderModifyVerifyService.java

@@ -90,17 +90,6 @@ public class YzActOrderModifyVerifyService {
         return dao.selectOne(qw);
     }
 
-    /**
-     * 审核状态的判断:
-     * 2 就把 申请的修改数据 通过 并改变申请表中的状态
-     * 3 就不通过 只要改变申请表中的状态就可以了
-     * 4 回撤把记录了老的数据
-     * @param auditFlag 状态 2:通过 3:不通过  4:回撤
-     * @param actOrderNo  医嘱号
-     * @param auditRemark  审核的信息
-     * @return 返回
-     * */
-
     /**
      * 审核判断要执行哪些动作
      * @param auditFlag 2-通过 3-不通过 4-数据回撤到最近一次的修改