소스 검색

feature: 下载样式优化

wuyongyi 2 년 전
부모
커밋
8138e51dc5

+ 1 - 1
src/main/java/com/ywt/mg/services/DownloadRecordService.java

@@ -159,7 +159,7 @@ public class DownloadRecordService {
                 item.put("status", p.getStatus());
                 item.put("statusStr", DownloadRecordStatusEnum.getDisplayName(p.getStatus()));
                 if(p.getStatus() == DownloadRecordStatusEnum.Default.getValue()){
-                    item.put("updateTime", "获取中");
+                    item.put("updateTime", "获取中...");
                 } else {
                     item.put("updateTime", FormatUtil.createTimeFormatDetail(p.getUpdateTime()));
                 }

+ 54 - 0
src/main/java/com/ywt/mg/services/PrescriptionServices.java

@@ -7,6 +7,7 @@ import com.ywt.mg.domain.entities.OrderPayment;
 import com.ywt.mg.domain.models.ConstantDef;
 import com.ywt.mg.domain.models.ExcelDataMap;
 import com.ywt.mg.domain.models.enums.*;
+import com.ywt.mg.domain.models.pojo.ExcelCollectPojo;
 import com.ywt.mg.domain.ywtDrugEntities.Pharmacy;
 import com.ywt.mg.domain.ywtDrugEntities.PrescriptionInfo;
 import com.ywt.mg.params.prescription.QueryPrescriptionListRequest;
@@ -38,6 +39,10 @@ public class PrescriptionServices {
     @Autowired
     private CommonServices commonServices;
 
+    @Autowired
+    private DownloadRecordService downloadRecordService;
+
+
 
     /**
      * 根据条件查询用药记录
@@ -394,9 +399,58 @@ public class PrescriptionServices {
                     map.getStringListSafely(col17).add(cancelStatusStr);
                     map.getStringListSafely(col18).add(Checker.getStringValue(p.getCancelRemark()));
 
+                    //统计支付总额和退费总额
+                    int paymentStatusInt = Checker.getIntegerValue(p.getPaymentStatus());
+                    int presStatus = Checker.getIntegerValue(p.getStatus());
+                    int payChanelInt = Checker.getIntegerValue(p.getPaymentChannel());
+
+                    if (presStatus == PrescriptionInfoStatusEnum.HaveARefund.getValue()) {
+                        refundTotal += Checker.getIntegerValue(p.getTotalPrice());
+
+                        if (payChanelInt == PresPaymentChannelEnum.WeChat.getValue()) {
+                            weChatRefundTotal += Checker.getIntegerValue(p.getTotalPrice());
+                        } else if (payChanelInt == PresPaymentChannelEnum.AliPay.getValue()) {
+                            aliRefundTotal += Checker.getIntegerValue(p.getTotalPrice());
+                        } else if (payChanelInt == PresPaymentChannelEnum.Cash.getValue()) {
+                            cashRefundTotal += Checker.getIntegerValue(p.getTotalPrice());
+                        } else if (payChanelInt == PresPaymentChannelEnum.MedicalCard.getValue()) {
+                            medicalCardRefundTotal += Checker.getIntegerValue(p.getTotalPrice());
+                        } else if (payChanelInt == PresPaymentChannelEnum.POS.getValue()) {
+                            posRefundTotal += Checker.getIntegerValue(p.getTotalPrice());
+                        } else if (payChanelInt == PresPaymentChannelEnum.MedicalInsurance.getValue()) {
+                            medicalInsuranceRefundTotal += Checker.getIntegerValue(p.getTotalPrice());
+                        } else if (payChanelInt == PresPaymentChannelEnum.ICBC.getValue()) {
+                            icbcRefundTotal += Checker.getIntegerValue(p.getTotalPrice());
+                        }
+                    }
+                    if (paymentStatusInt == PaymentStatusEnum.Success.getValue()) {
+                        payTotal += Checker.getIntegerValue(p.getTotalPrice());
+
+                        if (payChanelInt ==PresPaymentChannelEnum.WeChat.getValue()) {
+                            weChatPay += Checker.getIntegerValue(p.getTotalPrice());
+                        } else if (payChanelInt == PresPaymentChannelEnum.AliPay.getValue()) {
+                            aliPay += Checker.getIntegerValue(p.getTotalPrice());
+                        } else if (payChanelInt == PresPaymentChannelEnum.Cash.getValue()) {
+                            cashPay += Checker.getIntegerValue(p.getTotalPrice());
+                        } else if (payChanelInt == PresPaymentChannelEnum.MedicalCard.getValue()) {
+                            medicalCardPay += Checker.getIntegerValue(p.getTotalPrice());
+                        } else if (payChanelInt == PresPaymentChannelEnum.POS.getValue()) {
+                            posPay += Checker.getIntegerValue(p.getTotalPrice());
+                        } else if (payChanelInt == PresPaymentChannelEnum.MedicalInsurance.getValue()) {
+                            medicalInsurancePay += Checker.getIntegerValue(p.getTotalPrice());
+                        } else if (payChanelInt == PresPaymentChannelEnum.ICBC.getValue()) {
+                            icbcPay += Checker.getIntegerValue(p.getTotalPrice());
+                        }
+                    }
+
                 }
 
             }
+            int size = prescriptionInfoList.size();
+//            List<ExcelCollectPojo> itemList = getStatisticsData(size, payTotal);
+//            downloadRecordService.createFileAndUploadOssAndSaveToDataBase(fileName, downloadRecordId, map, itemList);
+
+
         } catch (Exception e) {
             e.printStackTrace();
         }

+ 38 - 4
src/main/java/com/ywt/mg/web/common/ExcelDownloadSrv.java

@@ -303,6 +303,24 @@ public class ExcelDownloadSrv {
             workbook = Workbook.createWorkbook(ba);
             // 工作表
             WritableSheet sheet = workbook.createSheet(fileName, 0);
+
+            //表头格式
+            WritableCellFormat cellFormat = ExcelDownloadSrv.getWritableCellFormat();
+            //数据行格式
+            // 设置背景、字体颜色、对齐方式等等;
+            WritableFont font2 = new WritableFont(WritableFont.ARIAL, 14, WritableFont.NO_BOLD, false, UnderlineStyle.NO_UNDERLINE, Colour.BLACK);
+            WritableCellFormat cellFormat2 = new WritableCellFormat(font2);
+            //设置文字居中对齐方式;
+            cellFormat2.setAlignment(Alignment.CENTRE);
+            //设置垂直居中;
+            cellFormat2.setVerticalAlignment(VerticalAlignment.CENTRE);
+            cellFormat2.setBackground(Colour.WHITE);
+            cellFormat2.setBorder(Border.ALL, BorderLineStyle.THIN);
+            cellFormat2.setWrap(true);
+            //给sheet电子版中所有的列设置默认的列的宽度;
+            sheet.getSettings().setDefaultColumnWidth(20);
+            sheet.getSettings().setDefaultRowHeight(30 * 20);
+
             //单独应用样式
             if (excelStyleMap != null) {
                 for (String column : excelStyleMap.keySet()) {
@@ -316,8 +334,11 @@ public class ExcelDownloadSrv {
                     }
                 }
             }
-            // 设置格式(实线)
-            WritableCellFormat cellFormat = new WritableCellFormat();
+//            // 设置格式(实线)
+//            WritableCellFormat cellFormat = new WritableCellFormat();
+//            //给sheet电子版中所有的列设置默认的列的宽度;
+//            sheet.getSettings().setDefaultColumnWidth(20);
+//            sheet.getSettings().setDefaultRowHeight(35 * 20);
             //行号
             int firstRow = 0;
             //填充表头
@@ -409,8 +430,22 @@ public class ExcelDownloadSrv {
              workbook = Workbook.createWorkbook(ba);
             // 工作表
             WritableSheet sheet = workbook.createSheet(fileName, 0);
+            //表头格式
+            WritableCellFormat cellFormat = ExcelDownloadSrv.getWritableCellFormat();
+            //数据行格式
+            // 设置背景、字体颜色、对齐方式等等;
             WritableFont font2 = new WritableFont(WritableFont.ARIAL, 14, WritableFont.NO_BOLD, false, UnderlineStyle.NO_UNDERLINE, Colour.BLACK);
             WritableCellFormat cellFormat2 = new WritableCellFormat(font2);
+            //设置文字居中对齐方式;
+            cellFormat2.setAlignment(Alignment.CENTRE);
+            //设置垂直居中;
+            cellFormat2.setVerticalAlignment(VerticalAlignment.CENTRE);
+            cellFormat2.setBackground(Colour.WHITE);
+            cellFormat2.setBorder(Border.ALL, BorderLineStyle.THIN);
+            cellFormat2.setWrap(true);
+            //给sheet电子版中所有的列设置默认的列的宽度;
+            sheet.getSettings().setDefaultColumnWidth(20);
+            sheet.getSettings().setDefaultRowHeight(30 * 20);
             //单独应用样式
             if (excelStyleMap != null) {
                 for (String column : excelStyleMap.keySet()) {
@@ -424,8 +459,7 @@ public class ExcelDownloadSrv {
                     }
                 }
             }
-            // 设置格式(实线)
-            WritableCellFormat cellFormat = new WritableCellFormat();
+
             //行号
             int firstRow = 0;
             //填充表头

+ 1 - 1
src/main/java/com/ywt/mg/web/controllers/CheckUpOrderController.java

@@ -53,7 +53,7 @@ public class CheckUpOrderController {
 //        }
         int downloadRecordId = idGenerator.genDownloadRecordId();
         String name = "公司后台-订单管理-体检缴费";
-        String fileName = "体检缴费列表";
+        String fileName = "体检缴费";
         String excelSuffixFormat = ConstantDef.EXCEL_SUFFIX_FORMAT;
         String paramUrl = "/checkUp/downloadCheckUpOrderList";
         String paramJson = JsonSerializer.toJson(request);

+ 1 - 1
src/main/java/com/ywt/mg/web/controllers/DepositController.java

@@ -55,7 +55,7 @@ public class DepositController {
         request.setHosp(0);
         int downloadRecordId = idGenerator.genDownloadRecordId();
         String name = "公司后台-订单管理-住院押金";
-        String fileName = "押金缴费记录";
+        String fileName = "住院押金";
         String excelSuffixFormat = ConstantDef.EXCEL_SUFFIX_FORMAT;
         String paramUrl = "/deposit/downloadDepositList";
         String paramJson = JsonSerializer.toJson(request);

+ 1 - 1
src/main/java/com/ywt/mg/web/controllers/MealOrderController.java

@@ -55,7 +55,7 @@ public class MealOrderController {
 //            request.setHospitalId(hospital);
 //        }
         int downloadRecordId = idGenerator.genDownloadRecordId();
-        String name = "公司后台-订单管理-订餐订单列表列表";
+        String name = "公司后台-订单管理-订餐订单";
         String fileName = "订餐订单列表";
         String excelSuffixFormat = ConstantDef.EXCEL_SUFFIX_FORMAT;
         String paramUrl = "/mealOrder/downloadMealOrderList";

+ 1 - 1
src/main/java/com/ywt/mg/web/controllers/NatOrderController.java

@@ -52,7 +52,7 @@ public class NatOrderController {
 //        }
         int downloadRecordId = idGenerator.genDownloadRecordId();
         String name = "公司后台-订单管理-核酸检测";
-        String fileName = "核酸检测记录";
+        String fileName = "核酸检测";
         String excelSuffixFormat = ConstantDef.EXCEL_SUFFIX_FORMAT;
         String paramUrl = "/natOrder/downloadNatOrderList";
         String paramJson = JsonSerializer.toJson(request);

+ 1 - 1
src/main/java/com/ywt/mg/web/controllers/OfflineController.java

@@ -314,7 +314,7 @@ public class OfflineController {
         // 插入记录
         int downloadRecordId = idGenerator.genDownloadRecordId();
         String name = "公司后台-订单管理-线下就诊";
-        String fileName = "线下就诊记录";
+        String fileName = "线下就诊";
         String excelSuffixFormat = ConstantDef.EXCEL_SUFFIX_FORMAT;
         String paramUrl = "/offline/downloadOfflineList";
         String paramJson = JsonSerializer.toJson(request);

+ 2 - 2
src/main/java/com/ywt/mg/web/controllers/OutpatientOrderController.java

@@ -49,8 +49,8 @@ public class OutpatientOrderController {
 //            request.setHospitalId(hospital);
 //        }
         int downloadRecordId = idGenerator.genDownloadRecordId();
-        String name = "公司后台-订单管理-门诊缴费订单列表";
-        String fileName = "门诊缴费记录";
+        String name = "公司后台-订单管理-门诊缴费订单";
+        String fileName = "门诊缴费";
         String excelSuffixFormat = ConstantDef.EXCEL_SUFFIX_FORMAT;
         String paramUrl = "/outpatient/downloadOutPatientOrderList";
         String paramJson = JsonSerializer.toJson(request);

+ 1 - 1
src/main/java/com/ywt/mg/web/controllers/RegisteredOrderController.java

@@ -50,7 +50,7 @@ public class RegisteredOrderController {
         request.setHosp(0);
         int downloadRecordId = idGenerator.genDownloadRecordId();
         String name = "公司后台-订单管理-挂号订单";
-        String fileName = "挂号订单记录";
+        String fileName = "预约挂号";
         String excelSuffixFormat = ConstantDef.EXCEL_SUFFIX_FORMAT;
         String paramUrl = "/registeredOrder/downloadRegisteredOrderList";
         String paramJson = JsonSerializer.toJson(request);

+ 1 - 1
src/main/java/com/ywt/mg/web/controllers/hospital/HospCheckUpOrderController.java

@@ -51,7 +51,7 @@ public class HospCheckUpOrderController {
 //        }
         int downloadRecordId = idGenerator.genDownloadRecordId();
         String name = "医院后台-订单管理-体检缴费";
-        String fileName = "体检缴费列表";
+        String fileName = "体检缴费";
         String excelSuffixFormat = ConstantDef.EXCEL_SUFFIX_FORMAT;
         String paramUrl = "/hosp/checkUp/downloadCheckUpOrderList";
         String paramJson = JsonSerializer.toJson(request);

+ 1 - 1
src/main/java/com/ywt/mg/web/controllers/hospital/HospDepositController.java

@@ -56,7 +56,7 @@ public class HospDepositController {
         request.setHosp(1);
         int downloadRecordId = idGenerator.genDownloadRecordId();
         String name = "医院后台-订单管理-住院押金";
-        String fileName = "押金缴费记录";
+        String fileName = "住院押金";
         String excelSuffixFormat = ConstantDef.EXCEL_SUFFIX_FORMAT;
         String paramUrl = "/hosp/deposit/downloadDepositList";
         String paramJson = JsonSerializer.toJson(request);

+ 1 - 1
src/main/java/com/ywt/mg/web/controllers/hospital/HospMealOrderController.java

@@ -56,7 +56,7 @@ public class HospMealOrderController {
 //            request.setHospitalId(hospital);
 //        }
         int downloadRecordId = idGenerator.genDownloadRecordId();
-        String name = "医院后台-订单管理-订餐订单列表列表";
+        String name = "医院后台-订单管理-订餐订单列表";
         String fileName = "订餐订单列表";
         String excelSuffixFormat = ConstantDef.EXCEL_SUFFIX_FORMAT;
         String paramUrl = "/hosp/mealOrder/downloadMealOrderList";

+ 2 - 2
src/main/java/com/ywt/mg/web/controllers/hospital/HospOutpatientOrderController.java

@@ -47,8 +47,8 @@ public class HospOutpatientOrderController {
         request.setHospitalId(hospital);
 
         int downloadRecordId = idGenerator.genDownloadRecordId();
-        String name = "医院后台-订单管理-门诊缴费订单列表";
-        String fileName = "门诊缴费记录";
+        String name = "医院后台-订单管理-门诊缴费订单";
+        String fileName = "门诊缴费";
         String excelSuffixFormat = ConstantDef.EXCEL_SUFFIX_FORMAT;
         String paramUrl = "/hosp/outpatient/downloadOutPatientOrderList";
         String paramJson = JsonSerializer.toJson(request);

+ 1 - 1
src/main/java/com/ywt/mg/web/controllers/hospital/HospRegisteredOrderController.java

@@ -52,7 +52,7 @@ public class HospRegisteredOrderController {
         request.setHosp(1);
         int downloadRecordId = idGenerator.genDownloadRecordId();
         String name = "医院后台-订单管理-挂号订单";
-        String fileName = "挂号订单记录";
+        String fileName = "预约挂号";
         String excelSuffixFormat = ConstantDef.EXCEL_SUFFIX_FORMAT;
         String paramUrl = "/hosp/registeredOrder/downloadRegisteredOrderList";
         String paramJson = JsonSerializer.toJson(request);