Ver Fonte

Merge remote-tracking branch 'origin/master'

周箭河 há 4 anos atrás
pai
commit
f332323cff

+ 15 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MusicGroupPaymentStudentCourseDetailDao.java

@@ -6,6 +6,7 @@ import java.util.List;
 
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentStudentCourseDetail;
 import com.ym.mec.common.dal.BaseDAO;
+
 import org.apache.ibatis.annotations.Param;
 
 public interface MusicGroupPaymentStudentCourseDetailDao extends BaseDAO<Long, MusicGroupPaymentStudentCourseDetail> {
@@ -63,4 +64,18 @@ public interface MusicGroupPaymentStudentCourseDetailDao extends BaseDAO<Long, M
      * @return
      */
     int deleteByUserIdAndMusicGroupId(@Param("userId") Integer userId, @Param("musicGroupId") String musicGroupId);
+    
+    /**
+     * 根据缴费编号删除信息
+     * @param musicGroupPaymentCalenderId
+     * @return
+     */
+    int deleteByMusicGroupPaymentCalenderId(Long musicGroupPaymentCalenderId);
+
+    /**
+     * 删除信息
+     * @param musicGroupPaymentCalenderDetailIdList
+     * @return
+     */
+    int deleteByMusicGroupPaymentCalenderDetailId(List<Long> musicGroupPaymentCalenderDetailIdList);
 }

+ 11 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/CourseScheduleDto.java

@@ -79,11 +79,22 @@ public class CourseScheduleDto extends CourseSchedule {
     //申述内容
     private String complaintsContent;
 
+    //申述凭证
+    private String url;
+
     //处理结果
     private String disposeContent;
 
     private int isNew;
 
+    public String getUrl() {
+        return url;
+    }
+
+    public void setUrl(String url) {
+        this.url = url;
+    }
+
     public Integer getSignInStatus() {
         return signInStatus;
     }

+ 1 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/CourseScheduleTeacherSalary.java

@@ -59,7 +59,7 @@ public class CourseScheduleTeacherSalary {
 	
 	private CourseSchedule courseSchedule = new CourseSchedule();
 
-	private BigDecimal reduceSalary;
+	private BigDecimal reduceSalary = BigDecimal.ZERO;
 
 	private TeacherSalaryConfirmStatus confirmStatus;
 

+ 2 - 2
mec-biz/src/main/java/com/ym/mec/biz/service/MusicGroupPaymentCalenderDetailService.java

@@ -67,7 +67,7 @@ public interface MusicGroupPaymentCalenderDetailService extends BaseService<Long
 
     /**
      * 批量删除缴费信息
-     * @param musicGroupPaymentCalenderIds
+     * @param musicGroupPaymentCalenderDetailIds
      */
-    void batchDel(String musicGroupPaymentCalenderIds);
+    void batchDel(String musicGroupPaymentCalenderDetailIds);
 }

+ 41 - 18
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentCalenderDetailServiceImpl.java

@@ -1,10 +1,39 @@
 package com.ym.mec.biz.service.impl;
 
-import com.ym.mec.biz.dal.dao.*;
+import static com.ym.mec.biz.dal.entity.MusicGroupStudentFee.PaymentStatus.NON_PAYMENT;
+
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import com.ym.mec.biz.dal.dao.MusicGroupDao;
+import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderCourseSettingsDao;
+import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderDao;
+import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderDetailDao;
+import com.ym.mec.biz.dal.dao.MusicGroupPaymentStudentCourseDetailDao;
+import com.ym.mec.biz.dal.dao.MusicGroupStudentFeeDao;
+import com.ym.mec.biz.dal.dao.SysConfigDao;
 import com.ym.mec.biz.dal.dto.FeeStudentDto;
 import com.ym.mec.biz.dal.dto.SimpleUserDto;
-import com.ym.mec.biz.dal.entity.*;
+import com.ym.mec.biz.dal.entity.MusicGroup;
+import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentCalenderStatusEnum;
+import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderCourseSettings;
+import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderDetail;
+import com.ym.mec.biz.dal.entity.MusicGroupPaymentStudentCourseDetail;
+import com.ym.mec.biz.dal.entity.MusicGroupStudentFee;
 import com.ym.mec.biz.dal.entity.MusicGroupStudentFee.PaymentStatus;
 import com.ym.mec.biz.dal.enums.MessageTypeEnum;
 import com.ym.mec.biz.service.MusicGroupPaymentCalenderDetailService;
@@ -16,18 +45,6 @@ import com.ym.mec.common.exception.BizException;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
 import com.ym.mec.thirdparty.message.MessageSenderPluginContext;
 
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
-import java.math.BigDecimal;
-import java.util.*;
-import java.util.stream.Collectors;
-
-import static com.ym.mec.biz.dal.entity.MusicGroupStudentFee.PaymentStatus.NON_PAYMENT;
-import static com.ym.mec.biz.dal.entity.MusicGroupStudentFee.PaymentStatus.PAID_COMPLETED;
-
 @Service
 public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl<Long, MusicGroupPaymentCalenderDetail>  implements MusicGroupPaymentCalenderDetailService {
 	
@@ -428,15 +445,21 @@ public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl<
 
 	@Override
 	@Transactional(rollbackFor = Exception.class)
-	public void batchDel(String musicGroupPaymentCalenderIds) {
-		List<MusicGroupPaymentCalenderDetail> details = musicGroupPaymentCalenderDetailDao.queryListByIds(musicGroupPaymentCalenderIds);
+	public void batchDel(String musicGroupPaymentCalenderDetailIds) {
+		List<MusicGroupPaymentCalenderDetail> details = musicGroupPaymentCalenderDetailDao.queryListByIds(musicGroupPaymentCalenderDetailIds);
 		if(details == null || details.size() == 0){
 			throw new BizException("删除失败: 数据不可为空");
 		}
-		long count = details.stream().filter(e -> e.getPaymentStatus() == PAID_COMPLETED).count();
+		long count = details.stream().filter(e -> e.getPaymentStatus() != NON_PAYMENT).count();
 		if(count > 0){
 			throw new BizException("删除失败: 存在已缴费的学员");
 		}
-		musicGroupPaymentCalenderDetailDao.batchDel(musicGroupPaymentCalenderIds);
+		musicGroupPaymentCalenderDetailDao.batchDel(musicGroupPaymentCalenderDetailIds);
+		
+		List<Long> musicGroupPaymentCalenderDetailIdList = new ArrayList<Long>();
+		for(String s : musicGroupPaymentCalenderDetailIds.split(",")){
+			musicGroupPaymentCalenderDetailIdList.add(Long.parseLong(s));
+		}
+		musicGroupPaymentStudentCourseDetailDao.deleteByMusicGroupPaymentCalenderDetailId(musicGroupPaymentCalenderDetailIdList);
 	}
 }

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

@@ -1221,12 +1221,13 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 		if (id == null) {
 			throw new BizException("参数校验失败");
 		}
-		MusicGroupPaymentCalender calender = musicGroupPaymentCalenderDao.get(id);
+		MusicGroupPaymentCalender calender = musicGroupPaymentCalenderDao.getForLock(id);
 		if (calender == null) {
 			throw new BizException("缴费信息不存在");
 		}
-		if (calender.getStatus() != PaymentCalenderStatusEnum.NO || calender.getStatus() != PaymentCalenderStatusEnum.REJECT) {
-			throw new BizException("删除失败,只有“拒绝”或“未开启缴费”状态才能删除");
+		if (calender.getStatus() != PaymentCalenderStatusEnum.AUDITING || calender.getStatus() != PaymentCalenderStatusEnum.NO
+				|| calender.getStatus() != PaymentCalenderStatusEnum.REJECT) {
+			throw new BizException("删除失败,只有[审核中]、[拒绝]或[未开启缴费]状态才能删除");
 		}
 
 		List<MusicGroupPaymentCalenderDetail> musicGroupPaymentCalenderDetailList = musicGroupPaymentCalenderDetailDao.queryByCalenderId(id,null);
@@ -1241,6 +1242,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 
 		musicGroupPaymentCalenderDao.delete(id);
 		musicGroupPaymentCalenderDetailDao.deleteByCalenderId(id);
+		musicGroupPaymentStudentCourseDetailDao.deleteByMusicGroupPaymentCalenderId(id);
 		
 		List<Long> calenderIds = new ArrayList<Long>();
 		calenderIds.add(id);

+ 2 - 0
mec-biz/src/main/resources/config/mybatis/CourseScheduleMapper.xml

@@ -72,6 +72,7 @@
         <result column="is_complaints_" property="isComplaints"/>
         <result column="complaints_status_" property="complaintsStatus"/>
         <result column="complaints_content_" property="complaintsContent"/>
+        <result column="url_" property="url"/>
         <result column="dispose_content_" property="disposeContent"/>
         <result column="seal_class_id_" property="sealClassId"/>
         <result column="total_student_num_" property="totalStudentNum"/>
@@ -744,6 +745,7 @@
                ta.sign_in_time_,
                ta.complaints_status_,
                ta.complaints_content_,
+               ta.url_,
                ta.dispose_content_,
                cs.teach_mode_
         FROM course_schedule_teacher_salary csts

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

@@ -188,7 +188,7 @@
 		DELETE FROM music_group_payment_calender_detail WHERE id_ = #{id}
 	</delete>
 	<delete id="batchDel">
-		DELETE FROM music_group_payment_calender_detail WHERE FIND_IN_SET(id_,#{musicGroupPaymentCalenderIds})
+		DELETE FROM music_group_payment_calender_detail WHERE FIND_IN_SET(id_,#{musicGroupPaymentCalenderIdDetails})
 	</delete>
 	<delete id="deleteByUserIdAndMusicGroupId">
 		DELETE FROM music_group_payment_calender_detail

+ 16 - 0
mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentStudentCourseDetailMapper.xml

@@ -121,6 +121,22 @@
         WHERE id_ = #{id}
     </delete>
 
+    <!-- 根据主键删除一条记录 -->
+    <delete id="deleteByMusicGroupPaymentCalenderId">
+        DELETE FROM music_group_payment_student_course_detail
+        WHERE music_group_payment_calender_id_ = #{musicGroupPaymentCalenderId}
+    </delete>
+    
+    <delete id="deleteByMusicGroupPaymentCalenderDetailId">
+        DELETE FROM music_group_payment_student_course_detail
+        <where>
+        	music_group_payment_calender_detail_id_ in    
+		    <foreach item="item" collection="list" separator="," open="(" close=")" index="">    
+		      #{item}    
+		    </foreach>
+        </where>
+    </delete>
+
     <!-- 分页查询 -->
     <select id="queryPage" resultMap="MusicGroupPaymentStudentCourseDetail"
             parameterType="map">

+ 6 - 2
mec-web/src/main/java/com/ym/mec/web/controller/MusicGroupPaymentCalenderDetailController.java

@@ -5,6 +5,7 @@ import io.swagger.annotations.ApiOperation;
 
 import java.math.BigDecimal;
 
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -69,8 +70,11 @@ public class MusicGroupPaymentCalenderDetailController extends BaseController {
     @ApiOperation(value = "批量删除缴费信息")
     @PostMapping("/batchDel")
     @PreAuthorize("@pcs.hasPermissions('musicGroupPaymentCalenderDetail/batchDel')")
-    public Object batchDel(String musicGroupPaymentCalenderIds) {
-        musicGroupPaymentCalenderDetailService.batchDel(musicGroupPaymentCalenderIds);
+    public Object batchDel(String musicGroupPaymentCalenderDetailIds) {
+    	if(StringUtils.isBlank(musicGroupPaymentCalenderDetailIds)){
+    		return failed("请求参数错误");
+    	}
+        musicGroupPaymentCalenderDetailService.batchDel(musicGroupPaymentCalenderDetailIds);
         return succeed();
     }