Browse Source

优化号表功能

hurugang 2 years ago
parent
commit
b10a6954c4

+ 18 - 18
src/main/java/cn/hnthyy/thmz/controller/api/MedicalViewApiController.java

@@ -1699,35 +1699,35 @@ public class MedicalViewApiController {
             }
             List<Map<String, Object>> removeList = new ArrayList<>();
             for (Map map : list) {
-                BigDecimal fee = BigDecimal.ZERO;
+                //BigDecimal fee = BigDecimal.ZERO;
                 String chargeType = (String) map.get("chargeType");
                 if (StringUtils.isNotBlank(chargeType)) {
                     MzyZdChargeType mzyZdChargeType = mzyZdChargeTypeService.queryByCode(chargeType);
                     if (mzyZdChargeType != null) {
                         map.put("chargeType", mzyZdChargeType.getName());
-                        if (mzyZdChargeType.getReqFee() == null) {
-                            mzyZdChargeType.setReqFee(BigDecimal.ZERO);
-                        }
-                        if (mzyZdChargeType.getClinicFee() == null) {
-                            mzyZdChargeType.setClinicFee(BigDecimal.ZERO);
-                        }
-                        if (mzyZdChargeType.getOthFee() == null) {
-                            mzyZdChargeType.setOthFee(BigDecimal.ZERO);
-                        }
-                        fee = fee.add(mzyZdChargeType.getReqFee()).add(mzyZdChargeType.getClinicFee()).add(mzyZdChargeType.getOthFee());
+//                        if (mzyZdChargeType.getReqFee() == null) {
+//                            mzyZdChargeType.setReqFee(BigDecimal.ZERO);
+//                        }
+//                        if (mzyZdChargeType.getClinicFee() == null) {
+//                            mzyZdChargeType.setClinicFee(BigDecimal.ZERO);
+//                        }
+//                        if (mzyZdChargeType.getOthFee() == null) {
+//                            mzyZdChargeType.setOthFee(BigDecimal.ZERO);
+//                        }
+                     //   fee = fee.add(mzyZdChargeType.getReqFee()).add(mzyZdChargeType.getClinicFee()).add(mzyZdChargeType.getOthFee());
                     }
                 }
-                BigDecimal checkFee = (BigDecimal) map.get("checkFee");
-                if (checkFee == null) {
-                    checkFee = BigDecimal.ZERO;
-                }
-                fee = fee.add(checkFee);
+//                BigDecimal checkFee = (BigDecimal) map.get("checkFee");
+//                if (checkFee == null) {
+//                    checkFee = BigDecimal.ZERO;
+//                }
+            //    fee = fee.add(checkFee);
 //                //周末挂号费为0,不收挂号费
 //                if(DateUtil.isWeekend(requestDayD)){
 //                    fee=BigDecimal.ZERO;
 //                }
-                map.put("fee", fee);
-                map.remove("checkFee");
+ //               map.put("fee", fee);
+ //               map.remove("checkFee");
                 String doctorCode = (String) map.get("doctorCode");
                 //核酸需要简易门诊
                 if (StringUtils.isBlank(doctorCode) && !Constants.JY_EXEC_CODE.equals(unitCode)) {

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

@@ -25,7 +25,7 @@ public interface MzyRequestMapper {
      * @return
      */
     @Select(" select rtrim(ampm) ampm from mzy_request_new WITH(NOLOCK) where request_day = #{requestDay,jdbcType=DATE} and unit_code = #{deptCode} group by ampm")
-    List<String> selectAmpmByRequestDayAndDeptCode(@Param("requestDay") String requestDay,@Param("deptCode") String deptCode);
+    List<String> selectAmpmByRequestDayAndDeptCode(@Param("requestDay") String requestDay, @Param("deptCode") String deptCode);
 
     /**
      * 按日期和时间区间查询可以挂号的科室编号
@@ -234,6 +234,7 @@ public interface MzyRequestMapper {
 
     /**
      * 更新最新的剩余号数
+     *
      * @param id
      * @param leftNum
      * @return
@@ -298,14 +299,17 @@ public interface MzyRequestMapper {
      * @return
      */
     @Select({"<script>",
-            "select doctor_code doctorCode,charge_type chargeType,check_fee checkFee,sum(left_num) leftNum from mzy_request_new WITH(NOLOCK) where unit_code=#{unitCode} and request_day=#{requestDay,jdbcType=TIMESTAMP}  and del_flag=0  and charge_type not in (16,24)",
+            "select doctor_code doctorCode,charge_type chargeType",
+            //",check_fee checkFee,sum(left_num) leftNum " ,
+            " from mzy_request_new WITH(NOLOCK) where unit_code=#{unitCode} and request_day=#{requestDay,jdbcType=TIMESTAMP}  and del_flag=0  and charge_type not in (16,24)",
             "<when test='ampms!=null'>",
             " and ampm  not in ",
             "<foreach item='item' index='index' collection='ampms' open='(' separator=',' close=')'>",
             "#{item}",
             "</foreach>",
             "</when>",
-            "  group by doctor_code,charge_type,check_fee",
+            "  group by doctor_code,charge_type",
+            //         ",check_fee",
             "</script>"})
     List<Map<String, Object>> selectDoctorByDateAndDept(@Param("requestDay") Date requestDay, @Param("ampms") List<String> ampms, @Param("unitCode") String unitCode);