| | |
| | | import com.dsh.course.entity.TCoursePackagePayment; |
| | | import com.dsh.course.feignclient.model.CourseOfStoreVo; |
| | | import com.dsh.course.feignclient.model.StuCourseResp; |
| | | import com.dsh.course.service.TCoursePackagePaymentService; |
| | | import com.dsh.course.service.TCoursePackageService; |
| | | import com.dsh.course.servs.CoursePackagePaymentRepository; |
| | | import io.swagger.annotations.Api; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.CrossOrigin; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | |
| | | |
| | | private Logger logger = LoggerFactory.getLogger("business-log"); |
| | | |
| | | |
| | | @Autowired |
| | | private CoursePackagePaymentRepository coursePackagePaymentRepository; |
| | | private TCoursePackagePaymentService packagePaymentService; |
| | | |
| | | @Autowired |
| | | private TCoursePackageService tcpService; |
| | |
| | | * @return 课包列表 |
| | | */ |
| | | @PostMapping("/coursePack/queryPayment") |
| | | public List<StuCourseResp> getStuCoursePackagePayment(Integer stuId){ |
| | | public List<StuCourseResp> getStuCoursePackagePayment(@RequestBody Integer stuId){ |
| | | List<StuCourseResp> resps = new ArrayList<>(); |
| | | List<TCoursePackagePayment> byUserId = coursePackagePaymentRepository.findByUserId(stuId); |
| | | List<TCoursePackagePayment> byUserId = packagePaymentService.queryAllCoursePackage(stuId); |
| | | if (byUserId.size() > 0 ){ |
| | | for (TCoursePackagePayment tCoursePackagePayment : byUserId) { |
| | | TCoursePackage tCoursePackage = tcpService.getById(tCoursePackagePayment.getCoursePackageId()); |
| | |
| | | resp.setTotalCourseNums(tCoursePackagePayment.getTotalClassHours()); |
| | | resp.setResidueNums(tCoursePackagePayment.getLaveClassHours()); |
| | | resp.setDeductionNums(tCoursePackagePayment.getTotalClassHours()-tCoursePackagePayment.getLaveClassHours()); |
| | | resps.add(resp); |
| | | } |
| | | } |
| | | return resps; |
| | |
| | | */ |
| | | @PostMapping("/coursePack/storeOfCourse") |
| | | public List<CourseOfStoreVo> getStuCourseWithStores(){ |
| | | List<CourseOfStoreVo> courseOfStoreVos = tcpService.queryStoreOfCourse(); |
| | | if (courseOfStoreVos.size() > 0){ |
| | | for (CourseOfStoreVo courseOfStoreVo : courseOfStoreVos) { |
| | | String[] split = courseOfStoreVo.getClassWeeks().split(";"); |
| | | List<Integer> integers = new ArrayList<>(); |
| | | for (String s : split) { |
| | | int num = Integer.parseInt(s); |
| | | integers.add(num); |
| | | } |
| | | courseOfStoreVo.setClassWeekList(integers); |
| | | } |
| | | } |
| | | return tcpService.queryStoreOfCourse(); |
| | | } |
| | | |