Bläddra i källkod

08 13 fix return

hr 4 år sedan
förälder
incheckning
ea5ac6202e

+ 2 - 0
src/main/java/com/imed/costaccount/common/util/PageUtils.java

@@ -1,6 +1,7 @@
 package com.imed.costaccount.common.util;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.fasterxml.jackson.annotation.JsonInclude;
 
 import java.io.Serializable;
 import java.math.BigDecimal;
@@ -37,6 +38,7 @@ public class PageUtils implements Serializable {
 	/**
 	 * 归集后的数据总额
 	 */
+	@JsonInclude(JsonInclude.Include.NON_NULL)
 	private BigDecimal totalAmount;
 	
 	/**

+ 1 - 1
src/main/java/com/imed/costaccount/model/dto/MenuEditDTO.java

@@ -29,7 +29,7 @@ public class MenuEditDTO {
     @NotNull(message = "菜单类型不能为空")
     private Integer type;
 
-    @NotBlank(message = "菜单图标不能为空")
+//    @NotBlank(message = "菜单图标不能为空")
     private String icon;
 
     private Integer orderNum;

+ 12 - 6
src/main/java/com/imed/costaccount/service/impl/IncomeCollectionServiceImpl.java

@@ -57,7 +57,7 @@ public class IncomeCollectionServiceImpl
      *
      * @param current  当前页
      * @param pageSize 页码数据大小
-     * @param date     日期 yyyy-MM-dd
+     * @param date     日期 yyyyMM
      * @param hospId   医院id
      * @return {@link PageUtils} 分页对象
      */
@@ -83,7 +83,7 @@ public class IncomeCollectionServiceImpl
         });
 
 
-        return new PageUtils(list, count, pageSize, current);
+        return new PageUtils(list, count, pageSize, current + 1);
     }
 
     /**
@@ -149,17 +149,23 @@ public class IncomeCollectionServiceImpl
                         afterIncomegroup.setDirectStatus(0);
                     }
                     incomeCollection.setIsDirectIncome(afterIncomegroup.getDirectStatus());
+                    String responsibilityCode = afterIncomegroup.getResponsibilityCode();
+                    if (StrUtil.isBlank(responsibilityCode)) {
+                        responsibilityCode = "-";
+                        afterIncomegroup.setResponsibilityName("-");
+                    }
                     // 开单中心的数据
                     incomeCollection.setDepartmentCode(afterIncomegroup.getOpenDepartmentCode());
                     incomeCollection.setDepartmentName(afterIncomegroup.getOpenDepartmentName());
-                    incomeCollection.setResponsibilityCode(afterIncomegroup.getResponsibilityCode());
+                    incomeCollection.setResponsibilityCode(responsibilityCode);
                     incomeCollection.setResponsibilityName(afterIncomegroup.getResponsibilityName());
 
                     list.add(incomeCollection);
                     // 执行科室数据
-                    incomeCollection.setDepartmentCode(afterIncomegroup.getStartDepartmentCode());
+                    String startDepartmentCode = afterIncomegroup.getStartDepartmentCode();
+                    incomeCollection.setDepartmentCode(startDepartmentCode);
                     incomeCollection.setDepartmentName(afterIncomegroup.getStartDepartmentName());
-                    incomeCollection.setResponsibilityCode(afterIncomegroup.getResponsibilityCode());
+                    incomeCollection.setResponsibilityCode(responsibilityCode);
                     incomeCollection.setResponsibilityName(afterIncomegroup.getResponsibilityName());
                     list.add(incomeCollection);
                 });
@@ -214,7 +220,7 @@ public class IncomeCollectionServiceImpl
         int count = baseMapper.getCollectListCount(collectDTO);
         BigDecimal totalAmount = baseMapper.getTotalAmount(collectDTO);
 
-        return new PageUtils(list, count, pageSize, current, totalAmount);
+        return new PageUtils(list, count, pageSize, current + 1, totalAmount);
     }
 
     /**

+ 12 - 7
src/main/resources/mapper/CostIncomeGroupMapper.xml

@@ -3,7 +3,7 @@
 
 <mapper namespace="com.imed.costaccount.mapper.CostIncomeGroupMapper">
 
-	<!-- 可根据自己的需求,是否要使用 -->
+    <!-- 可根据自己的需求,是否要使用 -->
     <resultMap type="com.imed.costaccount.model.CostIncomeGroup" id="costIncomeGroupMap">
         <result property="id" jdbcType="BIGINT" column="id"/>
         <result property="openDepartmentCode" column="open_department_code"/>
@@ -40,11 +40,12 @@
         <result property="deleteTime" column="delete_time"/>
     </resultMap>
 
-    <sql id="Base_Column_List" >
-    id, open_department_code, open_department_name, open_responsibility_code, open_responsibility_name, start_department_code, start_department_name, start_responsibility_code,
+    <sql id="Base_Column_List">
+        id
+        , open_department_code, open_department_name, open_responsibility_code, open_responsibility_name, start_department_code, start_department_name, start_responsibility_code,
     start_responsibility_name, product_code , product_name, account_code, account_name, open_department_amount, start_department_amount,amount,hosp_id,file_id,
     doctor_number ,doctor_name,patient_id,outpatient_id,patient_name, patient_fee ,receipt_fee ,total_number ,unit ,fee_datetime,date_year,date_month,create_time,delete_time
-  </sql>
+    </sql>
 
     <select id="countMoney" resultType="com.imed.costaccount.model.vo.CostIncomeGroupAllAmountVO">
         select
@@ -63,19 +64,23 @@
         from cost_income_group
         where hosp_id = #{hospId} and delete_time = 0
         <if test="date != null and date != ''">
-           and  date_year = YEAR(concat(#{date},'01')) and date_month = MONTH(concat(#{date},'01'))
+            and date_year = YEAR(concat(#{date},'01')) and date_month = MONTH(concat(#{date},'01'))
         </if>
         group by date_month, date_year
         limit #{startIndex},#{pageSize}
     </select>
 
     <select id="getCollectionCount" resultType="java.lang.Integer">
-        select count(*)
+
+        select count(*) from (
+        select id
         from cost_income_group
         where hosp_id = #{hospId} and delete_time = 0
         <if test="date != null and date != ''">
-           and date_year = YEAR(concat(#{date},'01')) and date_month = MONTH(concat(#{date},'01'))
+            and date_year = YEAR(concat(#{date},'01')) and date_month = MONTH(concat(#{date},'01'))
         </if>
+        group by date_month, date_year
+        ) t
     </select>