ruoyi-admin/pom.xml
@@ -8,8 +8,8 @@ <version>3.7.0</version> </parent> <modelVersion>4.0.0</modelVersion> <packaging>war</packaging> <!-- <packaging>jar</packaging>--> <!-- <packaging>war</packaging>--> <packaging>jar</packaging> <artifactId>smartor-opo</artifactId> <description> ruoyi-project/src/main/java/com/ruoyi/project/mapper/ServiceDonorchargeorganMapper.java
@@ -9,6 +9,7 @@ import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.HashMap; import java.util.List; /** @@ -29,6 +30,8 @@ public List<ServiceDonorchargeorgan> queryListBypaymentidIsNull(ServiceDonorchargeorgan serviceDonorchargeorgan); public HashMap<String,Object> organfeeSummary(ServiceDonorchargeorgan serviceDonorchargeorgan); public Boolean updateDonorchargeorgan(ServiceDonorchargeorgan serviceDonorchargeorgan); /** ruoyi-project/src/main/java/com/ruoyi/project/service/impl/ServiceDonorchargeorganServiceImpl.java
@@ -124,24 +124,25 @@ @Override public Map<String, Object> organfeeSummary(ServiceDonorchargeorgan serviceDonorchargeorgan) { List<ServiceDonorchargeorgan> list = Boolean.TRUE.equals(serviceDonorchargeorgan.getPaymentidIsNotNull()) ? queryList(serviceDonorchargeorgan) : queryListBypaymentidIsNull(serviceDonorchargeorgan); BigDecimal organchargeTotal = BigDecimal.ZERO; BigDecimal amountTotal = BigDecimal.ZERO; for (ServiceDonorchargeorgan item : list) { if (item.getOrgancharge() != null) { organchargeTotal = organchargeTotal.add(item.getOrgancharge()); } if (item.getAmount() != null) { amountTotal = amountTotal.add(item.getAmount()); } } Map<String, Object> summary = new HashMap<>(4); summary.put("organchargeTotal", organchargeTotal); summary.put("amountTotal", amountTotal); summary.put("unreceivedTotal", organchargeTotal.subtract(amountTotal)); summary.put("rowCount", list.size()); // List<ServiceDonorchargeorgan> list = Boolean.TRUE.equals(serviceDonorchargeorgan.getPaymentidIsNotNull()) // ? queryList(serviceDonorchargeorgan) // : queryListBypaymentidIsNull(serviceDonorchargeorgan); // BigDecimal organchargeTotal = BigDecimal.ZERO; // BigDecimal amountTotal = BigDecimal.ZERO; // for (ServiceDonorchargeorgan item : list) { // if (item.getOrgancharge() != null) { // organchargeTotal = organchargeTotal.add(item.getOrgancharge()); // } // if (item.getAmount() != null) { // amountTotal = amountTotal.add(item.getAmount()); // } // } // Map<String, Object> summary = new HashMap<>(4); // summary.put("organchargeTotal", organchargeTotal); // summary.put("amountTotal", amountTotal); // summary.put("unreceivedTotal", organchargeTotal.subtract(amountTotal)); // summary.put("rowCount", list.size()); Map<String, Object> summary =serviceDonorchargeorganMapper.organfeeSummary(serviceDonorchargeorgan); return summary; } ruoyi-project/src/main/resources/mapper/project/ServiceDonorchargeorganMapper.xml
@@ -189,6 +189,52 @@ order by b.donatetime </select> <select id="organfeeSummary" parameterType="com.ruoyi.project.domain.ServiceDonorchargeorgan" resultType="Map"> select sum(organcharge) organchargeTotal, sum(amount) amountTotal, sum(organcharge)- sum(amount) unreceivedTotal,count(*) rowCount from service_donorchargeorgan o <where> and (o.del_flag = 0 or o.del_flag is null) <if test="selectAll != true "> and (o.paymentid IS NULL or o.paymentid=0 or organcharge-amount>0) and (organ_charge_state =0 OR organ_charge_state IS null) </if> <if test="infoid != null ">and o.InfoID = #{infoid}</if> <if test="receiveTime != null ">and o.receive_time = #{receiveTime}</if> <if test="paymentno != null ">and o.paymentno = #{paymentno}</if> <if test="donorchargeid != null ">and o.donorchargeID = #{donorchargeid}</if> <if test="donorname != null and donorname != ''">and o.donorname like concat('%', #{donorname}, '%')</if> <if test="hospitalname != null and hospitalname != ''">and o.HospitalName like concat('%', #{hospitalname}, '%') </if> <if test="hospitalno != null and hospitalno != ''">and o.HospitalNo = #{hospitalno}</if> <if test="hospitalnoIsNull == true">and (o.Hospitalname is null or o.Hospitalname = '')</if> <if test="organno != null and organno != ''">and o.OrganNo = #{organno}</if> <if test="organname != null and organname != ''">and o.OrganName like concat('%', #{organname}, '%')</if> <if test="organState != null and organState != ''">and o.organ_state = #{organState}</if> <if test="payStatus != null and payStatus != ''"> <choose> <when test="payStatus == '已付'"> and o.organcharge is not null and (o.organcharge - IFNULL(o.amount, 0)) = 0 </when> <when test="payStatus == '未付'"> and o.organcharge is not null and (o.organcharge - IFNULL(o.amount, 0)) <> 0 </when> </choose> </if> <if test="organcharge != null ">and o.organcharge = #{organcharge}</if> <if test="organtime != null ">and o.organtime = #{organtime}</if> <if test="chargeoperator != null and chargeoperator != ''">and o.chargeoperator = #{chargeoperator}</if> <if test="amount != null ">and o.amount = #{amount}</if> <if test="amounttime != null ">and o.amounttime = #{amounttime}</if> <if test="amountoperator != null and amountoperator != ''">and o.amountoperator = #{amountoperator}</if> <if test="chargestate != null ">and o.chargestate = #{chargestate}</if> <if test="organchargedesc != null and organchargedesc != ''">and o.organchargedesc = #{organchargedesc}</if> <if test="starttime != null ">and donationtime >= #{starttime}</if> <if test="endtime != null ">and donationtime <= #{endtime}</if> </where> </select> <update id="removeByIds"> update service_donorchargeorgan set del_flag = 1