zouxuan 5 years ago
parent
commit
4868d9d452

+ 7 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MusicGroupPaymentCalenderDetailDao.java

@@ -1,5 +1,6 @@
 package com.ym.mec.biz.dal.dao;
 
+import java.math.BigDecimal;
 import java.util.List;
 
 import com.ym.mec.biz.dal.dto.SimpleUserDto;
@@ -45,4 +46,10 @@ public interface MusicGroupPaymentCalenderDetailDao extends BaseDAO<Long, MusicG
 	List<SimpleUserDto> findMusicGroupStudentWithSubject(@Param("musicGroupId") String musicGroupId,
 														 @Param("subjectId") Integer subjectId);
 
+	/**
+	 * 统计实际收款金额
+	 * @param id
+	 * @return
+	 */
+	BigDecimal sumActualAmount(@Param("id") Long id);
 }

+ 7 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/MusicGroupPaymentCalenderService.java

@@ -48,4 +48,11 @@ public interface MusicGroupPaymentCalenderService extends BaseService<Long, Musi
 	 * @param id
 	 */
 	void del(Long id);
+
+	/**
+	 * 获取明细
+	 * @param id
+	 * @return
+	 */
+    Object getDetail(Long id);
 }

+ 12 - 5
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentCalenderServiceImpl.java

@@ -2,11 +2,8 @@ package com.ym.mec.biz.service.impl;
 
 import static com.ym.mec.biz.dal.enums.PaymentStatusEnum.NO;
 
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Date;
-import java.util.List;
+import java.math.BigDecimal;
+import java.util.*;
 import java.util.stream.Collectors;
 
 import org.apache.commons.lang3.StringUtils;
@@ -247,4 +244,14 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 		}
 		musicGroupPaymentCalenderDao.delete(id);
 	}
+
+	@Override
+	public Object getDetail(Long id) {
+		MusicGroupPaymentCalender calender = musicGroupPaymentCalenderDao.get(id);
+		BigDecimal sumActualAmount = musicGroupPaymentCalenderDetailDao.sumActualAmount(id);
+		Map<String,Object> result = new HashMap<>(2);
+		result.put("calender",calender);
+		result.put("sumActualAmount",sumActualAmount);
+		return result;
+	}
 }

+ 4 - 0
mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentCalenderDetailMapper.xml

@@ -197,4 +197,8 @@
 		WHERE music_group_id_=#{musicGroupId} AND payment_status_ IN (1,2)
 		ORDER BY start_payment_date_ DESC LIMIT 1) t);
 	</select>
+	<select id="sumActualAmount" resultType="java.math.BigDecimal">
+		SELECT SUM(mgpcd.actual_amount_) FROM music_group_payment_calender_detail mgpcd
+		WHERE mgpcd.music_group_payment_calender_id_ = #{id} AND mgpcd.payment_status_ = "PAID_COMPLETED"
+	</select>
 </mapper>

+ 7 - 0
mec-web/src/main/java/com/ym/mec/web/controller/MusicGroupPaymentCalenderController.java

@@ -64,4 +64,11 @@ public class MusicGroupPaymentCalenderController extends BaseController {
     public Object queryPage(MusicCalenderQueryInfo queryInfo) {
         return succeed(musicGroupPaymentCalenderService.queryPage(queryInfo));
     }
+
+    @ApiOperation(value = "获取缴费信息")
+    @GetMapping("/getDetail")
+    @PreAuthorize("@pcs.hasPermissions('musicGroupPaymentCalender/getDetail')")
+    public Object getDetail(Long id) {
+        return succeed(musicGroupPaymentCalenderService.getDetail(id));
+    }
 }