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

Merge branch 'master' of https://172.16.32.165/lighter/web-server

xiaochan 2 роки тому
батько
коміт
82b12ebefe

+ 3 - 4
src/main/java/thyyxxk/webserver/controller/inpatient/nursemodule/PrintInfusionCardController.java

@@ -3,7 +3,6 @@ package thyyxxk.webserver.controller.inpatient.nursemodule;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 import thyyxxk.webserver.entity.ResultVo;
-import thyyxxk.webserver.entity.inpatient.nursemodule.response.InfusionCard;
 import thyyxxk.webserver.entity.inpatient.nursemodule.response.PatientBed;
 import thyyxxk.webserver.entity.inpatient.nursemodule.request.QueryInfusionCard;
 import thyyxxk.webserver.entity.inpatient.nursemodule.response.PatientInfusionInfo;
@@ -26,8 +25,8 @@ public class PrintInfusionCardController {
         return service.getPatientBeds(wardCode);
     }
 
-    @PostMapping("/queryInfusionCard")
-    public ResultVo<List<PatientInfusionInfo>> queryInfusionCard(@RequestBody QueryInfusionCard params) {
-        return service.queryInfusionCard(params);
+    @PostMapping("/queryInfusionCardOrBottleCard")
+    public ResultVo<List<PatientInfusionInfo>> queryInfusionCardOrBottleCard(@RequestBody QueryInfusionCard params) {
+        return service.queryInfusionCardOrBottleCard(params);
     }
 }

+ 83 - 80
src/main/java/thyyxxk/webserver/dao/his/inpatient/nursemodule/PrintInfusionCardDao.java

@@ -26,23 +26,21 @@ public interface PrintInfusionCardDao {
             "and a.ward=#{wardCode} and a.bed_no in (${bedNos}) order by cast(bed_no as int)")
     List<PatientBriefInfo> selectTargetPatients(String wardCode, String bedNos);
 
-    @Delete("delete from yz_act_occ_infusion_new where dept_code=#{wardCode} and ward_code=#{wardCode}")
+    @Delete("delete from yz_act_occ_infusion_new where ward_code=#{wardCode}")
     void deleteOldInfusion(String wardCode);
 
-    @Insert("insert into yz_act_occ_infusion_new(inpatient_no,admiss_times,dept_name,ward_name,act_order_no," +
-            "charge_code_0,drug_flag_0,specification_0,drug_occ_0,frequ_code_0,supply_name_0,supply_name_1," +
-            "start_time_0,end_time_0,dept_code,ward_code,drug_name_0,instruction_0,parent_no,instruction_1," +
-            "yz_dose,yz_dose_unit) " +
-            "select distinct rtrim(a.inpatient_no),a.admiss_times,rtrim(b.dept_code),#{wardCode}," +
-            "cast(cast(a.act_order_no as decimal) as varchar),rtrim(a.order_code),'i',rtrim(a.drug_specification)+" +
-            "'('+rtrim(isnull(e.print_name,''))+')'," +
+    @Insert("insert into yz_act_occ_infusion_new(inpatient_no,admiss_times,ward_code,act_order_no,charge_code," +
+            "drug_flag,specification,drug_occ,frequ_code,supply_name,start_time,end_time,drug_name,instruction," +
+            "parent_no,yz_dose,yz_dose_unit,entrust) " +
+            "select distinct rtrim(a.inpatient_no),a.admiss_times,#{wardCode}," +
+            "cast(cast(a.act_order_no as decimal) as varchar),rtrim(a.order_code),'i'," +
+            "rtrim(a.drug_specification)+'('+rtrim(isnull(e.print_name,''))+')'," +
             "rtrim(a.drug_occ),rtrim(d.code),rtrim(convert(varchar,a.dose))+isnull(f.name, '')," +
-            "rtrim(a.mini_unit),a.start_time,a.end_time,rtrim(b.dept_code),#{wardCode},rtrim(a.order_name)," +
-            "rtrim(e.supply_name),0,rtrim(a.instruction),rtrim(a.dose),rtrim(a.dose_unit) " +
+            "a.start_time,a.end_time,rtrim(a.order_name),rtrim(e.supply_name),0,rtrim(a.dose)," +
+            "rtrim(a.dose_unit),rtrim(a.instruction) " +
             "from yz_act_order a left join yp_zd_unit f on a.dose_unit=f.code," +
             "yz_act_occ b, zy_actpatient c, yz_order_frequency d,yz_supply_type e " +
-            "where b.dept_code=#{wardCode} ${alwaysFlag} and b.ward_code=#{wardCode} and " +
-            "b.occ_time>=#{startTime} and b.occ_time<=#{endTime} " +
+            "where b.ward_code=#{wardCode} ${alwaysFlag} and b.occ_time>=#{startTime} and b.occ_time<=#{endTime} " +
             "and isnull(b.status_flag, '')!='d' and a.status_flag>'1' and a.supply_code=e.supply_code " +
             "and e.class='2' and isnull(a.parent_no,0)=0 and a.inpatient_no=c.inpatient_no " +
             "and a.admiss_times=c.admiss_times and a.frequ_code=d.code ${printComment} " +
@@ -50,95 +48,100 @@ public interface PrintInfusionCardDao {
             "and(isnull(a.end_time,'')='' or a.frequ_code like '%ONCE%' or a.end_time>=getdate())")
     void insertNewInfusion(InfusionInsert data);
 
-    @Insert("insert into yz_act_occ_infusion_new(inpatient_no,admiss_times,dept_name,ward_name," +
-            "act_order_no,charge_code_0,drug_flag_0,specification_0,drug_occ_0,frequ_code_0," +
-            "supply_name_0,supply_name_1,start_time_0,end_time_0,dept_code,ward_code,drug_name_0," +
-            "instruction_0,parent_no,instruction_1,yz_dose,yz_dose_unit) " +
-            "select distinct rtrim(a.inpatient_no),a.admiss_times,rtrim(b.dept_code),rtrim(b.ward_code)," +
+    @Insert("insert into yz_act_occ_infusion_new(inpatient_no,admiss_times,ward_code,act_order_no," +
+            "charge_code,drug_flag,specification,drug_occ,frequ_code,supply_name,start_time,end_time," +
+            "drug_name,instruction,parent_no,yz_dose,yz_dose_unit,entrust) " +
+            "select distinct rtrim(a.inpatient_no),a.admiss_times,#{wardCode}," +
             "cast(cast(a.act_order_no as decimal) as varchar),rtrim(a.order_code),'i'," +
             "rtrim(a.drug_specification)+'('+rtrim(isnull(c.print_name,''))+')'," +
-            "rtrim(a.drug_occ),rtrim(b.frequ_code_0),rtrim(convert(varchar,a.dose))+isnull(d.name,'')," +
-            "rtrim(a.mini_unit),a.start_time,a.end_time,rtrim(b.dept_code),rtrim(b.ward_code)," +
-            "ltrim(rtrim(a.order_name)),rtrim(c.supply_name),cast(cast(a.parent_no as decimal) as varchar)," +
-            "rtrim(a.instruction),rtrim(a.dose),rtrim(a.dose_unit) from yz_act_order a left join yp_zd_unit d " +
+            "rtrim(a.drug_occ),rtrim(b.frequ_code),rtrim(convert(varchar,a.dose))+isnull(d.name,'')," +
+            "a.start_time,a.end_time,rtrim(a.order_name),rtrim(c.supply_name)," +
+            "cast(cast(a.parent_no as decimal) as varchar)," +
+            "rtrim(a.dose),rtrim(a.dose_unit),rtrim(a.instruction) from yz_act_order a left join yp_zd_unit d " +
             "on a.dose_unit=d.code,yz_act_occ_infusion_new b,yz_supply_type c where " +
-            "b.dept_code=#{wardCode} and b.ward_code=#{wardCode} and a.inpatient_no=b.inpatient_no " +
+            "b.ward_code=#{wardCode} and a.inpatient_no=b.inpatient_no " +
             "and a.admiss_times=b.admiss_times and a.parent_no=b.act_order_no and a.supply_code=c.supply_code " +
             "and(isnull(a.end_time,'')='' or a.frequ_code like '%ONCE%' or a.end_time>=getdate())")
     void insertInfusionAgain(String wardCode);
 
-    @Update("update yz_act_occ_infusion_new set inpatient_name=a.name," +
-            "yz_act_occ_infusion_new.bed_no=a.bed_no from zy_actpatient a where " +
-            "yz_act_occ_infusion_new.inpatient_no=a.inpatient_no and " +
-            "yz_act_occ_infusion_new.admiss_times=a.admiss_times")
-    void updateNewInfusion();
-
     @Select("select * from (" +
-            "select a.inpatient_no,a.act_order_no,a.admiss_times,a.bed_no,a.dept_code,a.ward_code,a.signer_0," +
-            "drug_name_0=a.drug_name_0+'('+cast(d.name as varchar(8))+')',a.specification_0,a.drug_occ_0," +
-            "a.frequ_code_0,a.supply_name_0,a.start_time_0,a.end_time_0,a.charge_code_0,occ_time=a.start_time_0," +
-            "a.drug_flag_0,a.instruction_0,a.parent_no,a.supply_name_1,a.instruction_1," +
-            "bz=(select top 1 case b.ps_status when 0 then '(阴性)' when 1 then '(阳性)' end from yz_act_order e " +
-            "where e.inpatient_no=b.inpatient_no and e.order_code=b.order_code and e.ps_status is not null and " +
-            "datediff(day,order_time,getdate())<=3 and ps_oper is not null), " +
-            "a.yz_dose,a.yz_dose_unit,b.order_code from yz_act_occ_infusion_new a,yz_act_order b, " +
+            "select a.inpatient_no,a.act_order_no,a.admiss_times,a.bed_no,a.ward_code,a.signer," +
+            "drug_name=a.drug_name+'('+cast(d.name as varchar(8))+')',a.specification,a.drug_occ," +
+            "a.frequ_code,a.supply_name,a.start_time,a.end_time,a.charge_code,occ_time=a.start_time," +
+            "a.drug_flag,a.instruction,a.parent_no,a.entrust,a.yz_dose,a.yz_dose_unit,b.order_code " +
+            "from yz_act_occ_infusion_new a,yz_act_order b, " +
             "(select code,max(manu_code)manu_code from yp_zd_dict group by code) c " +
             "left join yp_zd_manufactory d on c.manu_code=d.code " +
-            "where a.dept_code=#{wardcode} and a.ward_code=#{wardcode} and a.parent_no=0 " +
-            "and a.act_order_no=b.act_order_no and a.inpatient_no=b.inpatient_no and a.charge_code_0=c.code " +
+            "where a.ward_code=#{wardcode} and a.parent_no=0 and a.act_order_no=b.act_order_no " +
+            "and a.inpatient_no=b.inpatient_no and a.charge_code=c.code " +
             "union " +
-            "select a.inpatient_no,a.act_order_no,a.admiss_times,a.bed_no,a.dept_code,a.ward_code,a.signer_0, " +
-            "drug_name_0=a.drug_name_0,a.specification_0,a.drug_occ_0,a.frequ_code_0,a.supply_name_0," +
-            "a.start_time_0,a.end_time_0,a.charge_code_0,occ_time=a.start_time_0,a.drug_flag_0," +
-            "a.instruction_0,a.parent_no,a.supply_name_1,a.instruction_1, " +
-            "bz=(select top 1 case b.ps_status when 0 then '(阴性)' when 1 then '(阳性)' end from yz_act_order e " +
-            "where e.inpatient_no=b.inpatient_no and e.order_code=b.order_code and e.ps_status is not null), " +
-            "a.yz_dose,yz_dose_unit,b.order_code from yz_act_occ_infusion_new a,yz_act_order b " +
-            "where a.dept_code=#{wardcode} and a.ward_code=#{wardcode} and a.parent_no=0 and a.act_order_no=b.act_order_no " +
-            "and a.inpatient_no=b.inpatient_no and a.charge_code_0 not in (select code from yp_zd_dict group by code)" +
+            "select a.inpatient_no,a.act_order_no,a.admiss_times,a.bed_no,a.ward_code,a.signer, " +
+            "drug_name=a.drug_name,a.specification,a.drug_occ,a.frequ_code,a.supply_name," +
+            "a.start_time,a.end_time,a.charge_code,occ_time=a.start_time,a.drug_flag," +
+            "a.instruction,a.parent_no,a.entrust,a.yz_dose,yz_dose_unit,b.order_code " +
+            "from yz_act_occ_infusion_new a,yz_act_order b " +
+            "where a.ward_code=#{wardcode} and a.parent_no=0 and a.act_order_no=b.act_order_no " +
+            "and a.inpatient_no=b.inpatient_no and a.charge_code not in (select code from yp_zd_dict group by code)" +
             ") t order by t.act_order_no")
     List<YzActOccInfusionNew> selectMainDrugs(String wardCode);
 
     @Select("select * from (" +
-            "select a.inpatient_no,a.act_order_no,a.admiss_times,a.bed_no,a.dept_code,a.ward_code, " +
-            "drug_name_0=a.drug_name_0+'('+cast(d.name as varchar(8))+')',a.specification_0,a.drug_occ_0,a.frequ_code_0, " +
-            "a.supply_name_0,a.start_time_0,a.end_time_0,a.signer_0,a.charge_code_0,a.drug_flag_0,a.instruction_0, " +
-            "a.parent_no,a.supply_name_1,a.instruction_1, " +
-            "bz=(select top 1 case e.ps_status when 0 then '(阴性)' when 1 then '(阳性)' end from yz_act_order e " +
-            "where e.inpatient_no=b.inpatient_no and e.order_code=b.order_code and e.ps_status is not null " +
-            "and datediff(day,order_time,getdate())<=3 and ps_oper is not null), " +
-            "yz_dose=b.dose,yz_dose_unit=b.dose_unit,b.order_code " +
+            "select a.inpatient_no,a.act_order_no,a.admiss_times,a.bed_no,a.ward_code,a.parent_no, " +
+            "drug_name=a.drug_name+'('+cast(d.name as varchar(8))+')',a.specification,a.drug_occ,a.frequ_code, " +
+            "a.supply_name,a.start_time,a.end_time,a.signer,a.charge_code,a.drug_flag,a.instruction, " +
+            "yz_dose=b.dose,yz_dose_unit=b.dose_unit,b.order_code,a.entrust " +
             "from yz_act_occ_infusion_new a,yz_act_order b, " +
             "(select code,max(manu_code)manu_code from yp_zd_dict group by code)c " +
             "left join yp_zd_manufactory d on c.manu_code=d.code " +
-            "where a.dept_code=#{wardcode} and a.ward_code=#{wardcode} and a.parent_no!=0 and a.act_order_no=b.act_order_no " +
-            "and a.inpatient_no=b.inpatient_no and a.charge_code_0=c.code " +
+            "where a.ward_code=#{wardcode} and a.parent_no!=0 and a.act_order_no=b.act_order_no " +
+            "and a.inpatient_no=b.inpatient_no and a.charge_code=c.code " +
             "union " +
-            "select a.inpatient_no,a.act_order_no,a.admiss_times,a.bed_no,a.dept_code,a.ward_code, " +
-            "drug_name_0=a.drug_name_0,a.specification_0,a.drug_occ_0,a.frequ_code_0,a.supply_name_0,a.start_time_0, " +
-            "a.end_time_0,a.signer_0,a.charge_code_0,a.drug_flag_0,a.instruction_0,a.parent_no,a.supply_name_1, " +
-            "a.instruction_1,yz_dose=b.dose,yz_dose_unit=b.dose_unit,b.order_code, " +
-            "bz=(select top 1 case e.ps_status when 0 then '(阴性)' when 1 then '(阳性)' end from yz_act_order e " +
-            "where e.inpatient_no=b.inpatient_no and e.order_code=b.order_code and e.ps_status is not null " +
-            "and datediff(day,order_time,getdate())<=3)from yz_act_occ_infusion_new a,yz_act_order b " +
-            "where a.dept_code=#{wardcode} and a.ward_code=#{wardcode} and a.parent_no!=0 and a.act_order_no=b.act_order_no " +
-            "and a.inpatient_no=b.inpatient_no and a.charge_code_0 not in (select code from yp_zd_dict group by code)" +
+            "select a.inpatient_no,a.act_order_no,a.admiss_times,a.bed_no,a.ward_code,a.parent_no, " +
+            "drug_name=a.drug_name,a.specification,a.drug_occ,a.frequ_code,a.supply_name,a.start_time, " +
+            "a.end_time,a.signer,a.charge_code,a.drug_flag,a.instruction, " +
+            "yz_dose=b.dose,yz_dose_unit=b.dose_unit,b.order_code,a.entrust " +
+            "from yz_act_occ_infusion_new a,yz_act_order b " +
+            "where a.ward_code=#{wardcode} and a.parent_no!=0 and a.act_order_no=b.act_order_no " +
+            "and a.inpatient_no=b.inpatient_no and a.charge_code not in (select code from yp_zd_dict group by code)" +
             ") t order by t.act_order_no")
     List<YzActOccInfusionNew> selectSideDrugs(String wardCode);
 
-    @Select("SELECT a.act_order_no,countValue=count(1) " +
-            "FROM yz_act_occ_infusion_new a,yz_act_occ b WHERE " +
-            "a.ward_code=#{wardCode} AND a.parent_no=0 and a.inpatient_no=b.inpatient_no " +
-            "and a.admiss_times=b.admiss_times and a.act_order_no=b.act_order_no and " +
-            "b.occ_time>=#{startTime} and b.occ_time<=#{endTime} " +
-            "group by a.inpatient_no,a.act_order_no,a.admiss_times")
-    List<OccCount> selectOccCount(InfusionInsert data);
+    @Insert("insert into yz_act_occ_infusion_new(inpatient_no,admiss_times,ward_code,act_order_no," +
+            "charge_code,drug_flag,specification,drug_occ,frequ_code,supply_name,start_time," +
+            "end_time,drug_name,instruction,yz_dose,yz_dose_unit) " +
+            "select distinct rtrim(a.inpatient_no),a.admiss_times,#{wardCode}," +
+            "cast(cast(a.act_order_no as decimal) as varchar),rtrim(a.order_code),'i'," +
+            "rtrim(convert(varchar,a.dose))+isnull(f.name,''),a.drug_occ,rtrim(c.print_name)," +
+            "rtrim(a.supply_code),a.start_time,a.end_time, " +
+            "rtrim(a.order_name)+'('+rtrim(a.drug_specification)+')',rtrim(a.instruction),rtrim(a.dose)," +
+            "rtrim(a.dose_unit) from yz_act_order a left join yp_zd_unit f on a.dose_unit=f.code, " +
+            "yz_act_occ b,yz_order_frequency c,zy_actpatient d,yz_supply_type e " +
+            "where b.ward_code=#{wardCode} ${alwaysFlag} " +
+            "and b.occ_time>=#{startTime} and b.occ_time<=#{endTime} ${printComment} " +
+            "and isnull(b.status_flag,'')!='d' and d.dept=#{wardCode} and d.ward=#{wardCode} " +
+            "and a.status_flag>'1' and a.supply_code=e.supply_code and e.print_name!='iv' and e.class='2' " +
+            "and e.pring_flag='1' and isnull(a.parent_no,0)=0 and a.inpatient_no=d.inpatient_no " +
+            "and a.admiss_times=d.admiss_times and a.frequ_code=c.code and a.act_order_no=b.act_order_no " +
+            "and b.bed_no in (${bedNos})")
+    void insertNewBottleCard(InfusionInsert insert);
 
-    @Select("select rtrim(a.inpatient_no) as patNo,a.admiss_times as times, " +
-            "wardName=(select rtrim(d.name) from zd_unit_code d where d.code=#{wardCode}), " +
-            "rtrim(a.name) as patName,rtrim(bed_no)+N'床' as bedNo, " +
-            "patGender=case when a.sex='1' then '男' else '女' end, " +
-            "ageDays=datediff(day,b.birth_date,getdate()) from zy_actpatient a,a_patient_mi b " +
-            "where a.inpatient_no=#{patNo} and a.inpatient_no=b.inpatient_no")
-    PatientBriefInfo selectPatientBriefInfo(String patNo, String wardCode);
+    @Select("SELECT distinct a.inpatient_no,a.drug_occ,a.start_time,a.drug_name,a.frequ_code, " +
+            "a.act_order_no,a.instruction,a.specification FROM yz_act_occ_infusion_new a,yz_act_occ b " +
+            "WHERE isnull(a.visible_flag,'0')!='1' and a.ward_code=#{wardCode} " +
+            "and isnull(a.instruction,'') not like N'冲管%' " +
+            "and b.act_order_no=a.act_order_no and b.occ_time>=#{startTime} AND b.occ_time<=#{endTime} " +
+            "AND isnull(b.status_flag,'')!='d' order by a.inpatient_no,a.act_order_no")
+    List<YzActOccInfusionNew> selectMainDrugsForBottleCard(InfusionInsert insert);
+
+    @Select("SELECT DISTINCT rtrim(c.print_name) as frequCode,rtrim(a.order_name) as orderName, " +
+            "specification=cast(a.dose as varchar)+isnull(e.name,''),a.drug_occ, " +
+            "parentNo=cast(cast(a.parent_no as decimal) as varchar),a.start_time, " +
+            "actOrderNo=cast(cast(a.act_order_no as decimal) as varchar),a.act_order_no as ordeNo " +
+            "FROM yz_act_order a left join yp_zd_unit e on a.dose_unit=e.code, " +
+            "yz_supply_type b,yz_order_frequency c,yz_act_occ d " +
+            "WHERE a.supply_code=b.supply_code and a.frequ_code=c.code " +
+            "and a.act_order_no=d.act_order_no and a.parent_no is not null AND a.status_flag>'1' " +
+            "AND a.status_flag<='5' AND d.occ_time>=#{startTime} AND d.occ_time<=#{endTime} " +
+            "AND isnull(d.status_flag,'')!='d' AND d.ward_code=#{wardCode} order by a.act_order_no")
+    List<YzActOccInfusionNew> selectSideDrugsForBottleCard(InfusionInsert insert);
 }

+ 0 - 1
src/main/java/thyyxxk/webserver/entity/inpatient/nursemodule/response/InfusionCard.java

@@ -8,5 +8,4 @@ import java.util.List;
 public class InfusionCard {
     private YzActOccInfusionNew mainDrug;
     private List<YzActOccInfusionNew> sideDrugs;
-    private Integer mainDrugOccCount;
 }

+ 1 - 0
src/main/java/thyyxxk/webserver/entity/inpatient/nursemodule/response/PatientInfusionInfo.java

@@ -8,4 +8,5 @@ import java.util.List;
 public class PatientInfusionInfo {
     private PatientBriefInfo patInfo;
     private List<InfusionCard> drugGroups;
+    private List<YzActOccInfusionNew> bottleCardDrugs;
 }

+ 30 - 321
src/main/java/thyyxxk/webserver/entity/inpatient/nursemodule/response/YzActOccInfusionNew.java

@@ -1,329 +1,38 @@
 package thyyxxk.webserver.entity.inpatient.nursemodule.response;
 
 import java.io.Serializable;
+
 import lombok.Data;
+
 import java.util.Date;
 
 @Data
-public class YzActOccInfusionNew  implements Serializable {
-
-	private static final long serialVersionUID =  8493684899025730057L;
-
-	private String inpatientNo;
-
-	private String inpatientName;
-
-	private String deptName;
-
-	private String wardName;
-
-	private String bedNo;
-
-	private String actOrderNo;
-
-	private String drugName0;
-
-	private String drugName1;
-
-	private String drugName2;
-
-	private String drugName3;
-
-	private String drugName4;
-
-	private String drugName5;
-
-	private String drugName6;
-
-	private String drugName7;
-
-	private String drugName8;
-
-	private String drugName9;
-
-	private String drugName10;
-
-	private String specification0;
-
-	private String specification1;
-
-	private String specification2;
-
-	private String specification3;
-
-	private String specification4;
-
-	private String specification5;
-
-	private String specification6;
-
-	private String specification7;
-
-	private String specification8;
-
-	private String specification9;
-
-	private String specification10;
-
-	private String drugOcc0;
-
-	private String drugOcc1;
-
-	private String drugOcc2;
-
-	private String drugOcc3;
-
-	private String drugOcc4;
-
-	private String drugOcc5;
-
-	private String drugOcc6;
-
-	private String drugOcc7;
-
-	private String drugOcc8;
-
-	private String drugOcc9;
-
-	private String drugOcc10;
-
-	private String frequCode0;
-
-	private String frequCode1;
-
-	private String frequCode2;
-
-	private String frequCode3;
-
-	private String frequCode4;
-
-	private String frequCode5;
-
-	private String frequCode6;
-
-	private String frequCode7;
-
-	private String frequCode8;
-
-	private String frequCode9;
-
-	private String frequCode10;
-
-	private String supplyName0;
-
-	private String supplyName1;
-
-	private String supplyName2;
-
-	private String supplyName3;
-
-	private String supplyName4;
-
-	private String supplyName5;
-
-	private String supplyName6;
-
-	private String supplyName7;
-
-	private String supplyName8;
-
-	private String supplyName9;
-
-	private String supplyName10;
-
-	private Date startTime0;
-
-	private Date startTime1;
-
-	private Date startTime2;
-
-	private Date startTime3;
-
-	private Date startTime4;
-
-	private Date startTime5;
-
-	private Date startTime6;
-
-	private Date startTime7;
-
-	private Date startTime8;
-
-	private Date startTime9;
-
-	private Date startTime10;
-
-	private Date endTime0;
-
-	private Date endTime1;
-
-	private Date endTime2;
-
-	private Date endTime3;
-
-	private Date endTime4;
-
-	private Date endTime5;
-
-	private Date endTime6;
-
-	private Date endTime7;
-
-	private Date endTime8;
-
-	private Date endTime9;
-
-	private Date endTime10;
-
-	private String signer0;
-
-	private String signer1;
-
-	private String signer2;
-
-	private String signer3;
-
-	private String signer4;
-
-	private String signer5;
-
-	private String signer6;
-
-	private String signer7;
-
-	private String signer8;
-
-	private String signer9;
-
-	private String signer10;
-
-	private Integer admissTimes;
-
-	private String chargeCode0;
-
-	private String chargeCode1;
-
-	private String chargeCode2;
-
-	private String chargeCode3;
-
-	private String chargeCode4;
-
-	private String chargeCode5;
-
-	private String chargeCode6;
-
-	private String chargeCode7;
-
-	private String chargeCode8;
-
-	private String chargeCode9;
-
-	private String chargeCode10;
-
-	private String drugFlag0;
-
-	private String drugFlag1;
-
-	private String drugFlag2;
-
-	private String drugFlag3;
-
-	private String drugFlag4;
-
-	private String drugFlag5;
-
-	private String drugFlag6;
-
-	private String drugFlag7;
-
-	private String drugFlag8;
-
-	private String drugFlag9;
-
-	private String drugFlag10;
-
-	private String deptCode;
-
-	private String wardCode;
-
-	private String dosage0;
-
-	private String dosage1;
-
-	private String dosage2;
-
-	private String dosage3;
-
-	private String dosage4;
-
-	private String dosage5;
-
-	private String dosage6;
-
-	private String dosage7;
-
-	private String dosage8;
-
-	private String dosage9;
-
-	private String dosage10;
-
-	private String instruction0;
-
-	private String instruction1;
-
-	private String instruction2;
-
-	private String instruction3;
-
-	private String instruction4;
-
-	private String instruction5;
-
-	private String instruction6;
-
-	private String instruction7;
-
-	private String instruction8;
-
-	private String instruction9;
-
-	private String instruction10;
-
-	private String visibleFlag;
-
-	private String parentNo;
-
-	private String penStyle;
-
-	private String lineV0;
-
-	private String lineV1;
-
-	private String lineV2;
-
-	private String lineV3;
-
-	private String lineV4;
-
-	private String lineV5;
-
-	private String lineV6;
-
-	private String lineV7;
-
-	private String lineV8;
-
-	private String lineV9;
-
-	private String lineV10;
-
-	private String yzDose;
-
-	private String yzDoseUnit;
-
-	private Date occTime;
-
-	private String orderCode;
+public class YzActOccInfusionNew implements Serializable {
+
+    private static final long serialVersionUID = 8493684899025730057L;
+
+    private String inpatientNo;
+    private Integer admissTimes;
+    private String wardCode;
+    private String bedNo;
+    private String actOrderNo;
+    private String drugName;
+    private String specification;
+    private Double drugOcc;
+    private String frequCode;
+    private String supplyName;
+    private Date startTime;
+    private Date endTime;
+    private String signer;
+    private String chargeCode;
+    private String drugFlag;
+    private String dosage;
+    private String instruction;
+    private String visibleFlag;
+    private String parentNo;
+    private String entrust;
+    private String orderName;
+    private String yzDose;
+    private String yzDoseUnit;
+    private String startHour;
 }

+ 51 - 11
src/main/java/thyyxxk/webserver/service/inpatient/nursemodule/PrintInfusionCardService.java

@@ -32,16 +32,23 @@ public class PrintInfusionCardService {
         return ResultVoUtil.success(dao.selectPatientBedList(wardCode));
     }
 
-    public ResultVo<List<PatientInfusionInfo>> queryInfusionCard(QueryInfusionCard params) {
-        String wardCode = params.getWardCode();
+    public ResultVo<List<PatientInfusionInfo>> queryInfusionCardOrBottleCard(QueryInfusionCard params) {
         String bedNos = makeBedNos(params.getBedNos());
-        List<PatientBriefInfo> targetPatients = dao.selectTargetPatients(wardCode, bedNos);
+        InfusionInsert insert = getInfusionInsert(params, params.getWardCode(), bedNos);
+        if (params.getCardType() == CardType.INFUSION_CARD) {
+            return queryInfusionCard(insert);
+        }
+        return queryBottleCard(insert);
+    }
+
+    private ResultVo<List<PatientInfusionInfo>> queryInfusionCard(InfusionInsert insert) {
+        String wardCode = insert.getWardCode();
+        List<PatientBriefInfo> targetPatients = dao.selectTargetPatients(wardCode, insert.getBedNos());
         String prefix = "▲";
-        InfusionInsert insert = getInfusionInsert(params, wardCode, bedNos);
+
         dao.deleteOldInfusion(wardCode);
         dao.insertNewInfusion(insert);
         dao.insertInfusionAgain(wardCode);
-        dao.updateNewInfusion();
         List<YzActOccInfusionNew> mainDrugs = dao.selectMainDrugs(wardCode);
 
         if (mainDrugs.isEmpty()) {
@@ -49,13 +56,9 @@ public class PrintInfusionCardService {
         }
 
         List<YzActOccInfusionNew> sideDrugs = dao.selectSideDrugs(wardCode);
-        List<OccCount> occCounts = dao.selectOccCount(insert);
-        HashMap<String, Integer> occMap = new HashMap<>();
-        occCounts.forEach(item -> occMap.put(item.getActOrderNo(), item.getCountValue()));
-
         Map<String, List<YzActOccInfusionNew>> sideDrugMap = new HashMap<>();
         sideDrugs.forEach(drug -> {
-            drug.setDrugName0(prefix + drug.getDrugName0());
+            drug.setDrugName(prefix + drug.getDrugName());
             String key = drug.getParentNo();
             if (sideDrugMap.containsKey(key)) {
                 sideDrugMap.get(key).add(drug);
@@ -69,7 +72,6 @@ public class PrintInfusionCardService {
         for (YzActOccInfusionNew item : mainDrugs) {
             InfusionCard card = new InfusionCard();
             card.setMainDrug(item);
-            card.setMainDrugOccCount(occMap.get(item.getActOrderNo()));
             List<YzActOccInfusionNew> sideDrugList = sideDrugMap.get(item.getActOrderNo());
             if (null == sideDrugList) {
                 list.add(card);
@@ -104,6 +106,44 @@ public class PrintInfusionCardService {
         return ResultVoUtil.success(response);
     }
 
+    private ResultVo<List<PatientInfusionInfo>> queryBottleCard(InfusionInsert insert) {
+        String wardCode = insert.getWardCode();
+        List<PatientBriefInfo> targetPatients = dao.selectTargetPatients(wardCode, insert.getBedNos());
+        Map<String, PatientBriefInfo> patInfoMap = new HashMap<>();
+        for (PatientBriefInfo info : targetPatients) {
+            info.setAgeLabel(DateUtil.calculateAgeLabelByDays(info.getAgeDays()));
+            patInfoMap.put(info.getPatNo(), info);
+        }
+        dao.deleteOldInfusion(wardCode);
+        dao.insertNewBottleCard(insert);
+        List<YzActOccInfusionNew> mainDrugs = dao.selectMainDrugsForBottleCard(insert);
+        List<YzActOccInfusionNew> sideDrugs = dao.selectSideDrugsForBottleCard(insert);
+
+        List<PatientInfusionInfo> response = new ArrayList<>();
+        for (YzActOccInfusionNew main : mainDrugs) {
+            main.setStartHour(DateUtil.formatDatetime(main.getStartTime(), "HH:mm"));
+            PatientInfusionInfo info = new PatientInfusionInfo();
+            info.setPatInfo(patInfoMap.get(main.getInpatientNo()));
+            info.setBottleCardDrugs(fetchDrugsForBottleCard(main, sideDrugs));
+            response.add(info);
+        }
+        return ResultVoUtil.success(response);
+    }
+
+    private List<YzActOccInfusionNew> fetchDrugsForBottleCard(YzActOccInfusionNew main, List<YzActOccInfusionNew> sideDrugs) {
+        List<YzActOccInfusionNew> list = new ArrayList<>();
+        list.add(main);
+        String prefix = "▲";
+        for (YzActOccInfusionNew drug : sideDrugs) {
+            if (drug.getParentNo().equals(main.getActOrderNo())) {
+                drug.setDrugName(prefix + drug.getOrderName());
+                drug.setStartHour(DateUtil.formatDatetime(drug.getStartTime(), "HH:mm"));
+                list.add(drug);
+            }
+        }
+        return list;
+    }
+
     private InfusionInsert getInfusionInsert(QueryInfusionCard params, String wardCode, String bedNos) {
         InfusionInsert insert = new InfusionInsert();
         insert.setStartTime(params.getExecuteDate() + " 00:00:00.000");