Переглянути джерело

借阅,复印,封存的优化。

lighter 1 рік тому
батько
коміт
80315ad531

+ 22 - 0
src/main/java/thyyxxk/webserver/controller/inpatient/casefrontsheet/CaseFrontSheetController.java

@@ -173,6 +173,17 @@ public class CaseFrontSheetController {
         return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, response);
     }
 
+    @GetMapping("/getMarkStateDetail")
+    public ResultVo<MarkStateRequest> getMarkStateDetail(@RequestParam("bah") String bah,
+                                                         @RequestParam("times") int times,
+                                                         @RequestParam("type") String type) {
+        MarkStateRequest request = service.getMarkStateDetail(bah, times, type);
+        if (null == request) {
+            return ResultVoUtil.fail(ExceptionEnum.NO_DATA_EXIST);
+        }
+        return ResultVoUtil.success(request);
+    }
+
     @GetMapping("/signedByDateCount")
     public ResultVo<Map<String, List<SheetOverview>>> signedByDateCount(@RequestParam("signDate") String signDate) {
         return ResultVoUtil.success(service.signedByDateCount(signDate));
@@ -231,4 +242,15 @@ public class CaseFrontSheetController {
         }
         return ResultVoUtil.fail(ExceptionEnum.INTERNAL_SERVER_ERROR, response);
     }
+
+    @GetMapping("/getLendOutDetail")
+    public ResultVo<LendOutRequest> getLendOutDetail(@RequestParam("bah") String bah,
+                                                         @RequestParam("times") int times) {
+        LendOutRequest request = service.getLendOutDetail(bah, times);
+        if (null == request) {
+            return ResultVoUtil.fail(ExceptionEnum.NO_DATA_EXIST);
+        }
+        return ResultVoUtil.success(request);
+    }
+
 }

+ 0 - 1
src/main/java/thyyxxk/webserver/controller/medicalinsurance/MarkMtFeesController.java

@@ -152,7 +152,6 @@ public class MarkMtFeesController {
         return mzService.queryModifyPermission(info);
     }
 
-
     @PassToken
     @PostMapping("/modifyFundPayAmount")
     public Map<String, Object> modifyFundPayAmount(@RequestBody ModifyFundAmt modifyFundAmt) {

+ 32 - 9
src/main/java/thyyxxk/webserver/dao/his/inpatient/casefrontsheet/CaseFrontSheetDao.java

@@ -568,6 +568,7 @@ public interface CaseFrontSheetDao extends BaseMapper<CaseFrontsheetMain> {
 
     @Select("select *, " +
             "duplicated=(select count(1) from t_case_frontsheet_duplicate where bah=#{bah} and times=#{times})," +
+            "lendout=(select count(1) from t_case_frontsheet_lendout where bah=#{bah} and times=#{times} and state='LEND_OUT')," +
             "closedown=(select count(1) from t_case_frontsheet_closedown where bah=#{bah} and times=#{times}) " +
             "from t_case_frontsheet_main where bah=#{bah} and admiss_times=#{times} and file_status=1")
     CaseFrontsheetMain selectStoredSheetMain(@Param("bah") String bah, @Param("times") Integer times);
@@ -672,13 +673,14 @@ public interface CaseFrontSheetDao extends BaseMapper<CaseFrontsheetMain> {
     @Delete("delete from t_case_frontsheet_main where bah=#{bah} and admiss_times=#{times}")
     void deleteOldSheet(String bah, int times);
 
-    @Insert("insert into t_case_frontsheet_duplicate (bah, times, duplicate_staff, " +
-            "visit_staff, remark) " +
-            "values (#{bah},#{times},#{opStaff},#{visitStaff},#{remark})")
+    @Insert("insert into t_case_frontsheet_duplicate (bah,times,duplicate_time,duplicate_staff, " +
+            "visit_staff,remark) " +
+            "values (#{bah},#{times},#{markTime},#{opStaff},#{visitStaff},#{remark})")
     int executeDuplicate(MarkStateRequest request);
 
-    @Insert("insert into t_case_frontsheet_closedown (bah, times, closedown_staff, remark) " +
-            "values (#{bah},#{times},#{opStaff},#{remark})")
+    @Insert("insert into t_case_frontsheet_closedown (bah,times,closedown_time,closedown_staff," +
+            "remark,visit_staff) " +
+            "values (#{bah},#{times},#{markTime},#{opStaff},#{remark},#{visitStaff})")
     int executeClosedown(MarkStateRequest request);
 
     @Select("select bah,admiss_times as times,name,sex,sign_staff, " +
@@ -703,12 +705,13 @@ public interface CaseFrontSheetDao extends BaseMapper<CaseFrontsheetMain> {
     List<SheetOverview> getSimpleSheetForLendOut(String bah);
 
     @Insert("<script>" +
-            "insert into t_case_frontsheet_lendout (bah,times,lend_staff,remark,op_staff, " +
-            "pat_name,dis_date,dis_dept) " +
+            "insert into t_case_frontsheet_lendout (bah,times,lend_staff,lend_time,remark,op_staff, " +
+            "pat_name,dis_date,dis_dept,lend_staff_phone) " +
             "values " +
             "<foreach collection='list' item='item' separator=','>" +
-            "(#{item.bah},#{item.times},#{lendStaff}," +
-            "#{remark},#{opStaff},#{item.name},#{item.disDate},#{item.deptName})" +
+            "(#{item.bah},#{item.times},#{lendStaff},#{lendTime}," +
+            "#{remark},#{opStaff},#{item.name},#{item.disDate}," +
+            "#{item.deptName},#{lendStaffPhone})" +
             "</foreach>" +
             "</script>")
     int insertLendOutInfo(LendOutRequest request);
@@ -718,4 +721,24 @@ public interface CaseFrontSheetDao extends BaseMapper<CaseFrontsheetMain> {
 
     @Update("update t_case_frontsheet_lendout set state='RETURNED',return_time=getdate() where id=#{id}")
     int returnSheet(int id);
+
+    @Select("select top 1 bah,times, " +
+            "opStaff=(select rtrim(d.name) from a_employee_mi d where d.code=duplicate_staff), " +
+            "visit_staff,remark,duplicate_time as markTime " +
+            "from t_case_frontsheet_duplicate a where a.bah=#{bah} and a.times=#{times} " +
+            "order by duplicate_time desc")
+    MarkStateRequest selectExistRequest(String bah, int times);
+
+    @Select("select top 1 bah,times, " +
+            "opStaff=(select rtrim(d.name) from a_employee_mi d where d.code=closedown_staff), " +
+            "visit_staff,remark,closedown_time as markTime " +
+            "from t_case_frontsheet_closedown a where a.bah=#{bah} and a.times=#{times} " +
+            "order by closedown_time desc")
+    MarkStateRequest selectExistRequest2(String bah, int times);
+
+    @Select("select top 1 bah,times,lend_staff,lend_staff_phone,remark,lend_time, " +
+            "opStaff=(select rtrim(d.name) from a_employee_mi d where d.code=op_staff) " +
+            "from t_case_frontsheet_lendout where bah=#{bah} and times=#{times} and state='LEND_OUT' " +
+            "order by lend_time desc")
+    LendOutRequest selectExistLendOut(String bah, int times);
 }

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

@@ -841,6 +841,9 @@ public class CaseFrontsheetMain implements Serializable {
     @TableField(exist = false)
     private Integer closedown;
 
+    @TableField(exist = false)
+    private Integer lendout;
+
     public List<CaseFrontsheetDisdiag> getDisdiagList() {
         return null == disdiagList ? new ArrayList<>() : disdiagList;
     }

+ 5 - 0
src/main/java/thyyxxk/webserver/entity/casefrontsheet/request/LendOutRequest.java

@@ -2,12 +2,17 @@ package thyyxxk.webserver.entity.casefrontsheet.request;
 
 import lombok.Data;
 
+import java.util.Date;
 import java.util.List;
 
 @Data
 public class LendOutRequest {
     private List<SheetOverview> list;
+    private String bah;
+    private Integer times;
     private String lendStaff;
+    private String lendStaffPhone;
     private String remark;
     private String opStaff;
+    private Date lendTime;
 }

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

@@ -2,6 +2,8 @@ package thyyxxk.webserver.entity.casefrontsheet.request;
 
 import lombok.Data;
 
+import java.util.Date;
+
 @Data
 public class MarkStateRequest {
     private String bah;
@@ -9,4 +11,5 @@ public class MarkStateRequest {
     private String opStaff;
     private String visitStaff;
     private String remark;
+    private Date markTime;
 }

+ 14 - 0
src/main/java/thyyxxk/webserver/service/inpatient/casefrontsheet/CaseFrontSheetMainService.java

@@ -1028,6 +1028,13 @@ public class CaseFrontSheetMainService {
         return "OK";
     }
 
+    public MarkStateRequest getMarkStateDetail(String bah, int times, String type) {
+        if (type.equals("DUPLICATE")) {
+            return dao.selectExistRequest(bah, times);
+        }
+        return dao.selectExistRequest2(bah, times);
+    }
+
     public Map<String, List<SheetOverview>> signedByDateCount(String signDate) {
         String start = signDate + " 00:00:00.000";
         String end = signDate + " 23:59:59.999";
@@ -1085,6 +1092,9 @@ public class CaseFrontSheetMainService {
         if (StringUtil.isBlank(request.getRemark())) {
             return "备注不能为空。";
         }
+        if (null == request.getList() || request.getList().isEmpty()) {
+            return "借阅病案不能为空。";
+        }
         request.setOpStaff(TokenUtil.getInstance().getTokenUserId());
         int insert = dao.insertLendOutInfo(request);
         if (insert == 0) {
@@ -1104,4 +1114,8 @@ public class CaseFrontSheetMainService {
         }
         return "OK";
     }
+
+    public LendOutRequest getLendOutDetail(String bah, int times) {
+        return dao.selectExistLendOut(bah, times);
+    }
 }