yonge 4 éve
szülő
commit
0bbc92f593

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

@@ -7,7 +7,6 @@ import com.ym.mec.biz.dal.dto.MusicGroupPaymentCalenderAuditDto;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender;
 import com.ym.mec.biz.dal.page.MusicGroupPaymentCalenderQueryInfo;
 import com.ym.mec.common.page.PageInfo;
-import com.ym.mec.common.page.QueryInfo;
 import com.ym.mec.common.service.BaseService;
 
 public interface MusicGroupPaymentCalenderService extends BaseService<Long, MusicGroupPaymentCalender> {
@@ -17,7 +16,7 @@ public interface MusicGroupPaymentCalenderService extends BaseService<Long, Musi
 	 * @param musicGroupPaymentCalender
 	 * @return
 	 */
-	boolean create(MusicGroupPaymentCalender musicGroupPaymentCalender);
+	Long create(MusicGroupPaymentCalender musicGroupPaymentCalender);
 
 	/**
 	 * 获取明细

+ 2 - 33
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentCalenderServiceImpl.java

@@ -82,7 +82,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 
 	@Override
 	@Transactional(rollbackFor = Exception.class)
-	public boolean create(MusicGroupPaymentCalender musicGroupPaymentCalender) {
+	public Long create(MusicGroupPaymentCalender musicGroupPaymentCalender) {
 		
 		String musicGroupId = musicGroupPaymentCalender.getMusicGroupId();
 
@@ -97,7 +97,6 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 		}
 		Date date = new Date();
 		Map<Integer, String> pushUserMap = new HashMap<>();
-		MusicGroupPaymentCalenderDetail musicGroupPaymentCalenderDetail = null;
 		List<MusicGroupPaymentCalenderDetail> musicGroupPaymentCalenderDetailList = new ArrayList<>();
 		musicGroupPaymentCalender.setOperator(sysUser.getId());
 		musicGroupPaymentCalender.setCreateTime(date);
@@ -160,36 +159,6 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 		}
 
 		musicGroupPaymentCalender.setExpectNum(0);
-		if(StringUtils.isNoneBlank(musicGroupPaymentCalender.getStudentIds())){
-			String[] sutdentIdList = musicGroupPaymentCalender.getStudentIds().split(",");
-			musicGroupPaymentCalender.setExpectNum(sutdentIdList.length);
-			
-			if (musicGroupPaymentCalender.getStatus() == PaymentCalenderStatusEnum.OPEN) {
-				for(String studentId : sutdentIdList){
-					pushUserMap.put(Integer.parseInt(studentId), studentId);
-				}
-			}
-
-			BigDecimal totalPrice = new BigDecimal(0);
-			//相同类型的课程如果修改了课程费用,需要走审批
-			for(Entry<CourseScheduleType, BigDecimal> entry : currentCoursePrice.entrySet()){
-				totalPrice.add(entry.getValue());
-			}
-			//创建缴费明细
-			for(String studentId : sutdentIdList){
-				musicGroupPaymentCalenderDetail = new MusicGroupPaymentCalenderDetail();
-				musicGroupPaymentCalenderDetail.setMusicGroupPaymentCalenderId(musicGroupPaymentCalender.getId());
-				musicGroupPaymentCalenderDetail.setCreateTime(date);
-				musicGroupPaymentCalenderDetail.setExpectAmount(totalPrice);
-				musicGroupPaymentCalenderDetail.setPaymentStatus(PaymentStatus.NON_PAYMENT);
-				musicGroupPaymentCalenderDetail.setUpdateTime(date);
-				musicGroupPaymentCalenderDetail.setUserId(Integer.parseInt(studentId));
-				musicGroupPaymentCalenderDetail.setStartPaymentDate(musicGroupPaymentCalender.getStartPaymentDate());
-				musicGroupPaymentCalenderDetail.setDeadlinePaymentDate(musicGroupPaymentCalender.getDeadlinePaymentDate());
-				
-				musicGroupPaymentCalenderDetailList.add(musicGroupPaymentCalenderDetail);
-			}
-		}
 		//设置批次号
 		musicGroupPaymentCalender.setBatchNo(idGeneratorService.generatorId()+"");
 		musicGroupPaymentCalenderDao.insert(musicGroupPaymentCalender);
@@ -214,7 +183,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 			sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG, MessageTypeEnum.STUDENT_PUSH_WAIT_RENEW_MESSAGE,
 					pushUserMap, null, 0, memo, "STUDENT", musicGroup.getName());
 		}
-		return true;
+		return musicGroupPaymentCalender.getId();
 	}
 
 	@Override

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

@@ -11,12 +11,15 @@ import com.ym.mec.biz.service.MusicGroupPaymentCalenderCourseSettingsService;
 import com.ym.mec.biz.service.MusicGroupPaymentCalenderService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
+
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.MediaType;
 import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.ui.ModelMap;
 import org.springframework.web.bind.annotation.*;
 
 import java.util.Arrays;
@@ -55,8 +58,10 @@ public class MusicGroupPaymentCalenderController extends BaseController {
     @PostMapping(value = "/add", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
     @PreAuthorize("@pcs.hasPermissions('musicGroupPaymentCalender/add')")
     public Object add(@RequestBody MusicGroupPaymentCalender musicGroupPaymentCalender) {
-        musicGroupPaymentCalenderService.create(musicGroupPaymentCalender);
-        return succeed();
+        Long musicGroupPaymentCalenderId = musicGroupPaymentCalenderService.create(musicGroupPaymentCalender);
+        ModelMap map = new ModelMap();
+        map.put("musicGroupPaymentCalenderId", musicGroupPaymentCalenderId);
+        return succeed(map);
     }
 
     @ApiOperation(value = "删除乐团缴费日历")