Преглед на файлове

调整收费清单格式

hurugang преди 2 години
родител
ревизия
8a0d1d6871

+ 2 - 1
src/main/java/cn/hnthyy/thmz/Utils/ExcelUtil.java

@@ -564,7 +564,7 @@ public class ExcelUtil {
         data.put(FILE_NAME_KEY, "收费清单.xls");
         List<Map<String, Object>> heads = new ArrayList<>();
         Map<String, Object> map0 = new HashMap<>();
-        String[] head0 = {"病人ID", "机制号", "退欠标识", "金额", "发票号", "付款方式", "收费日期", "项目名称", "合同编号", "患者地址"};
+        String[] head0 = {"病人ID","病人姓名", "机制号", "退欠标识", "金额", "发票号", "付款方式", "收费日期", "项目名称", "合同编号", "患者地址"};
         String[] headNum0 = {"0,0,0,0"};
         map0.put(HEAD_ARR_KEY, head0);
         map0.put(HEAD_NUM_KEY, headNum0);
@@ -574,6 +574,7 @@ public class ExcelUtil {
         chargeFeeVos.forEach(chargeFeeVo -> {
             if (chargeFeeVo != null) {
                 String[] temp = {chargeFeeVo.getPatientId(),
+                        chargeFeeVo.getPatientName(),
                         chargeFeeVo.getSerialNo(),
                         chargeFeeVo.getPayMark(),
                         chargeFeeVo.getTotalCharge().setScale(2, BigDecimal.ROUND_HALF_UP).toString(),

+ 39 - 10
src/main/java/cn/hnthyy/thmz/controller/mz/ChargeFeeVoController.java

@@ -82,7 +82,7 @@ public class ChargeFeeVoController {
             resultMap.put("code", 0);
             resultMap.put("message", "查询日结列表收费清单成功");
             List<ChargeFeeVo> chargeFeeVos = chargeFeeVoService.queryChargeFeeVoUnAccount(tokenUser.getUserIdCode());
-            fomartChargeVo(chargeFeeVos, YesNoEnum.NO,YesNoEnum.NO);
+            fomartChargeVo(chargeFeeVos, YesNoEnum.NO,YesNoEnum.YES);
             resultMap.put("data", chargeFeeVos);
             return resultMap;
         } catch (MzException e) {
@@ -103,9 +103,9 @@ public class ChargeFeeVoController {
      *
      * @param chargeFeeVos
      * @param fitEmpName 是否设置医生名称
-     * @param fitAddress 是否设置患者地址
+     * @param fitPatientInfo 是否设置患者信息
      */
-    private void fomartChargeVo(List<ChargeFeeVo> chargeFeeVos, YesNoEnum fitEmpName,YesNoEnum fitAddress) {
+    private void fomartChargeVo(List<ChargeFeeVo> chargeFeeVos, YesNoEnum fitEmpName,YesNoEnum fitPatientInfo) {
         if (chargeFeeVos != null && chargeFeeVos.size() > 0) {
             List<ZdChequeType> chequeTypes = zdChequeTypeService.queryAllZdChequeTypeForMz();
             Map<String, String> employeeMap = null;
@@ -121,9 +121,38 @@ public class ChargeFeeVoController {
             Map<String, String> chequeTypeMap = chequeTypes.stream().collect(Collectors.toMap(ZdChequeType::getCode, ZdChequeType::getName));
             Map<String, String> regionMap=null;
             StringBuffer sbf =null;
-            if(YesNoEnum.YES.equals(fitAddress)){
+            Map<String, MzPatientMi> mzPatientMiMap = null;
+            if(YesNoEnum.YES.equals(fitPatientInfo)){
                 regionMap = regionService.queryAll().stream().collect(Collectors.toMap(CodeNameEntity::getCode, CodeNameEntity::getName));
                 sbf = new StringBuffer();
+                Set<String> patientIdSet= chargeFeeVos.stream().map(ChargeFeeVo::getPatientId).collect(Collectors.toSet());
+                List<String> patientIds = new ArrayList<>(patientIdSet);
+                List<String> tempList = new ArrayList<>();
+                List<MzPatientMi> mzPatientMis=null;
+                int count=0;
+                for(String patientId:patientIds){
+                    tempList.add(patientId);
+                    count++;
+                    if(count==1000){
+                        if(mzPatientMis==null){
+                            mzPatientMis=mzPatientMiService.queryByPatientIds(tempList);
+                        }else {
+                            mzPatientMis.addAll(mzPatientMiService.queryByPatientIds(tempList));
+                        }
+                        count=0;
+                        tempList=new ArrayList<>();
+                    }
+                }
+                if(count>0){
+                    if(mzPatientMis==null){
+                        mzPatientMis=mzPatientMiService.queryByPatientIds(tempList);
+                    }else {
+                        mzPatientMis.addAll(mzPatientMiService.queryByPatientIds(tempList));
+                    }
+                }
+                if (mzPatientMis != null) {
+                    mzPatientMiMap = mzPatientMis.stream().collect(Collectors.toMap(MzPatientMi::getPatientId, mzPatientMi -> mzPatientMi));
+                }
             }
             for (ChargeFeeVo co : chargeFeeVos) {
                 PayMarkEnum payMark = PayMarkEnum.getPayMarkByCode(co.getPayMark());
@@ -139,8 +168,8 @@ public class ChargeFeeVoController {
                 if (YesNoEnum.YES.equals(fitEmpName)) {
                     co.setOpId(employeeMap.get(co.getOpId()));
                 }
-                if(YesNoEnum.YES.equals(fitAddress)){
-                    MzPatientMi mzPatientMi=mzPatientMiService.queryByPatientId(co.getPatientId());
+                if (mzPatientMiMap != null) {
+                    MzPatientMi mzPatientMi = mzPatientMiMap.get(co.getPatientId());
                     if(mzPatientMi==null){
                         continue;
                     }
@@ -164,8 +193,8 @@ public class ChargeFeeVoController {
                         sbf.setLength(0);
                     }
                     co.setAddress(mzPatientMi.getAddress());
+                    co.setPatientName(mzPatientMi.getName());
                 }
-
             }
         }
     }
@@ -214,7 +243,7 @@ public class ChargeFeeVoController {
             resultMap.put("code", 0);
             resultMap.put("message", "日结汇总的收费清单成功");
             List<ChargeFeeVo> chargeFeeVos = chargeFeeVoService.queryChargeFeeVoCollect(chargeFeeParamsVo.getCaseType(), chargeFeeParamsVo.getBeginDate(), chargeFeeParamsVo.getEndDate());
-            fomartChargeVo(chargeFeeVos, YesNoEnum.YES,YesNoEnum.NO);
+            fomartChargeVo(chargeFeeVos, YesNoEnum.YES,YesNoEnum.YES);
             resultMap.put("data", chargeFeeVos);
             return resultMap;
         } catch (Exception e) {
@@ -253,7 +282,7 @@ public class ChargeFeeVoController {
             resultMap.put("code", 0);
             resultMap.put("message", "重打结算单的收费清单成功");
             List<ChargeFeeVo> chargeFeeVos = chargeFeeVoService.queryChargeFeeVoReprint(chargeFeeParamsVo.getOpId(), chargeFeeParamsVo.getCaseType(), chargeFeeParamsVo.getDcountDate());
-            fomartChargeVo(chargeFeeVos, YesNoEnum.NO,YesNoEnum.NO);
+            fomartChargeVo(chargeFeeVos, YesNoEnum.NO,YesNoEnum.YES);
             resultMap.put("data", chargeFeeVos);
             return resultMap;
         } catch (Exception e) {
@@ -447,7 +476,7 @@ public class ChargeFeeVoController {
             //重打日结收费清单
             if (type == 1) {
                 List<ChargeFeeVo> chargeFeeVos = chargeFeeVoService.queryChargeFeeVoReprint(opId, YesNoEnum.NO.code.toString(), dcountDateD);
-                fomartChargeVo(chargeFeeVos, YesNoEnum.NO,YesNoEnum.NO);
+                fomartChargeVo(chargeFeeVos, YesNoEnum.NO,YesNoEnum.YES);
                 ExcelUtil.exportExcelForChargeDetail(request, response, chargeFeeVos);
                 return null;
             }

+ 3 - 3
src/main/java/cn/hnthyy/thmz/mapper/his/mz/ChargeFeeVoMapper.java

@@ -22,7 +22,7 @@ public interface ChargeFeeVoMapper {
      */
 
     @Select("   select " +
-            "   patient_id=m.patient_id, " +
+            "   patient_id=rtrim(m.patient_id), " +
             "  serial_no =m.serial_no, " +
             "   total_charge=isnull(m.amount,0), " +
             "   m.pay_mark," +
@@ -45,7 +45,7 @@ public interface ChargeFeeVoMapper {
      * @return
      */
     @Select("   select " +
-            "   patient_id=m.patient_id, " +
+            "   patient_id=rtrim(m.patient_id), " +
             "  serial_no =m.serial_no, " +
             "   total_charge=isnull(m.amount,0), " +
             "   m.pay_mark," +
@@ -71,7 +71,7 @@ public interface ChargeFeeVoMapper {
      * @return
      */
     @Select("   select " +
-            "   patient_id=m.patient_id, " +
+            "   patient_id=rtrim(m.patient_id), " +
             "  serial_no =m.serial_no, " +
             "   total_charge=isnull(m.amount,0), " +
             "   m.pay_mark," +

+ 2 - 0
src/main/java/cn/hnthyy/thmz/vo/ChargeFeeVo.java

@@ -36,4 +36,6 @@ public class ChargeFeeVo {
     private String contractNo;
     //患者地址
     private String address;
+    //患者姓名
+    private String patientName;
 }

+ 5 - 0
src/main/resources/static/js/mz/daily.js

@@ -675,6 +675,11 @@ function getsfqd() {
                 title: '病人ID',
                 align: "center",
                 valign: 'middle'
+            }, {
+                field: 'patientName',
+                title: '病人姓名',
+                align: "center",
+                valign: 'middle'
             }, {
                 field: 'serialNo',
                 title: '机制号',

+ 5 - 0
src/main/resources/static/js/mz/daily_collect.js

@@ -681,6 +681,11 @@ function getsfqd() {
                 title: '病人ID',
                 align: "center",
                 valign: 'middle'
+            }, {
+                field: 'patientName',
+                title: '病人姓名',
+                align: "center",
+                valign: 'middle'
             }, {
                 field: 'serialNo',
                 title: '机制号',

+ 5 - 0
src/main/resources/static/js/mz/daily_repeat_print.js

@@ -841,6 +841,11 @@ function getsfqd() {
                 title: '病人ID',
                 align: "center",
                 valign: 'middle'
+            }, {
+                field: 'patientName',
+                title: '病人姓名',
+                align: "center",
+                valign: 'middle'
             }, {
                 field: 'serialNo',
                 title: '机制号',