| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.dsh.course.dto.*; |
| | | import com.dsh.course.entity.CoursePackageOrderStudent; |
| | | import com.dsh.course.entity.EvaluateStudent; |
| | | import com.dsh.course.feignClient.account.AppUserClient; |
| | | import com.dsh.course.feignClient.account.StudentClient; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.management.relation.RelationService; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | |
| | | String formattedDate = dateFormat.format(new Date()); |
| | | model.addAttribute("reDate", formattedDate); |
| | | |
| | | List<TCoursePackagePayment> coursePackagePayments = courseStuddentClient.queryByIds(ids); |
| | | List<CoursePackageOrderStudent> coursePackagePayments = courseStuddentClient.queryByIds(ids); |
| | | |
| | | BigDecimal countAll = new BigDecimal(0); |
| | | |
| | | for (TCoursePackagePayment payment : coursePackagePayments){ |
| | | for (CoursePackageOrderStudent payment : coursePackagePayments){ |
| | | |
| | | //课包名称 |
| | | TCoursePackage tCoursePackage = coursePackageClient.queryById(payment.getCoursePackageId()); |
| | | List<CoursePackageOrder> ordes = courseStuddentClient.getOrder(payment.getId()); |
| | | |
| | | |
| | | |
| | | payment.setName(tCoursePackage.getName()); |
| | | payment.setId(Long.valueOf(tCoursePackage.getId())); |
| | | |
| | | BigDecimal cashPayment = payment.getCashPayment(); |
| | | |
| | | BigDecimal cashPayment = BigDecimal.ZERO; |
| | | for (CoursePackageOrder order : ordes) { |
| | | BigDecimal cashPayment1 = order.getCashPayment(); |
| | | if (cashPayment1 != null) { |
| | | cashPayment = cashPayment.add(cashPayment1); |
| | | } |
| | | } |
| | | payment.setCashPayment(cashPayment); |
| | | // BigDecimal cashPayment = payment.getCashPayment(); |
| | | if (cashPayment==null){ |
| | | cashPayment = BigDecimal.ZERO; |
| | | } |
| | |
| | | return PREFIX + "tStudentEdit_first.html"; |
| | | } |
| | | |
| | | @Autowired |
| | | private IMenuService menuService; |
| | | |
| | | @Autowired |
| | | private IRelationService relationService; |
| | | @RequestMapping("/tStudent_info/{tStudentId}") |
| | | public String tStudentInfo(@PathVariable("tStudentId") Integer tStudentId, Model model) { |
| | | System.out.println("======>t"+tStudentId); |
| | |
| | | |
| | | model.addAttribute("item", tStudentDto); |
| | | if (tStudentDto.getLateralSurface()!=null&&!tStudentDto.equals("")) { |
| | | String[] pics = tStudentDto.getLateralSurface().split(";"); |
| | | model.addAttribute("pic1", pics[0]); |
| | | System.out.println("=====pic1==" + pics[0]); |
| | | if (pics.length > 1) { |
| | | model.addAttribute("pic2", pics[1]); |
| | | System.out.println("=====pic2==" + pics[1]); |
| | | } |
| | | if (pics.length > 2) { |
| | | model.addAttribute("pic3", pics[2]); |
| | | System.out.println("=====pic3==" + pics[2]); |
| | | } |
| | | model.addAttribute("images",tStudentDto.getLateralSurface()); |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | |
| | | System.out.println("=======controller====studentClassInfo==="+studentClassInfo); |
| | | |
| | | |
| | | User user = UserExt.getUser(); |
| | | |
| | | List<Relation> list = relationService.list(new QueryWrapper<Relation>().eq("menuid", 391).eq("roleid", user.getRoleid())); |
| | | if (!list.isEmpty()){ |
| | | model.addAttribute("back",false); |
| | | }else { |
| | | model.addAttribute("back",true); |
| | | } |
| | | |
| | | return PREFIX + "tStudentEdit.html"; |
| | | } |
| | | |
| | |
| | | @RequestMapping("/getUseTime/{tStudentId}") |
| | | @ResponseBody |
| | | public ResultUtil getMax(@PathVariable("tStudentId") Integer tStudentId) { |
| | | Date useTime = courseStuddentClient.getUseTime(tStudentId); |
| | | Date vali = studentClient.getById(tStudentId); |
| | | |
| | | // Date useTime = courseStuddentClient.getUseTime(tStudentId); |
| | | Map<String, Date> map = new HashMap<>(); |
| | | map.put("useTime",useTime); |
| | | map.put("useTime",vali); |
| | | |
| | | return new ResultUtil<>(0,0,null,map,null); |
| | | } |
| | |
| | | // 需要过滤体验课 |
| | | List<ClassListDto> classListDtos = courseStuddentClient.listClass(tStudentId); |
| | | for (ClassListDto classListDto : classListDtos) { |
| | | classListDto.setHasClassHours(classListDto.getTotalClassHours()-classListDto.getLaveClassHours()); |
| | | if (classListDto.getClassType()==2){ |
| | | classListDto.setTotalClassHours(null); |
| | | classListDto.setHasClassHours(null); |
| | | classListDto.setLaveClassHours(null); |
| | | continue; |
| | | } |
| | | classListDto.setHasClassHours(classListDto.getTotalClassHours()-classListDto.getLaveClassHours()); |
| | | |
| | | } |
| | | Map<String,List<ClassListDto>> map = new HashMap<>(); |
| | | map.put("items",classListDtos); |
| | |
| | | insertBackDto.setIds(ids); |
| | | System.out.println("=====insertBackDto========"+insertBackDto); |
| | | |
| | | courseStuddentClient.insertBack(insertBackDto); |
| | | Integer i = courseStuddentClient.insertBack(insertBackDto); |
| | | |
| | | if (i == 1){ |
| | | return ResultUtil.error("当前课程已在退费申请中"); |
| | | } |
| | | //取消排课 |
| | | courseStuddentClient.cancel(ids); |
| | | System.out.println("============学员查询接口========="); |
| | | // courseStuddentClient.cancel(ids); |
| | | // System.out.println("============学员查询接口========="); |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | |
| | | @RequestMapping("/changeStatus/{id}") |
| | | @ResponseBody |
| | | public ResultUtil changeStatus(@PathVariable Integer id) { |
| | | // InsertBackDto insertBackDto= new InsertBackDto(); |
| | | // insertBackDto.setId(id); |
| | | //// insertBackDto.setIds(ids); |
| | | // System.out.println("=====insertBackDto========"+insertBackDto); |
| | | |
| | | courseStuddentClient.changeStatus(id); |
| | | courseStuddentClient.zeroClass(id); |
| | | |
| | | System.out.println("============学员查询接口========="); |
| | | return new ResultUtil<>(0,0,"同意成功",null,null); |
| | | return new ResultUtil<>(0,0,"已同意",null,null); |
| | | } |
| | | |
| | | @RequestMapping("/noStatus/{id}") |
| | | @ResponseBody |
| | | public ResultUtil noStatus(@PathVariable Integer id) { |
| | | // InsertBackDto insertBackDto= new InsertBackDto(); |
| | | // insertBackDto.setId(id); |
| | | //// insertBackDto.setIds(ids); |
| | | // System.out.println("=====insertBackDto========"+insertBackDto); |
| | | |
| | | courseStuddentClient.noStatus(id); |
| | | courseStuddentClient.backStausClass(id); |
| | | // courseStuddentClient.zeroClass(id); |
| | | |
| | | System.out.println("============学员查询接口========="); |
| | | return new ResultUtil<>(0,0,"同意成功",null,null); |
| | | return new ResultUtil<>(0,0,"已拒绝",null,null); |
| | | } |
| | | |
| | | /** |
| | |
| | | @ResponseBody |
| | | |
| | | public ResultUtil update(@RequestBody TStudent tStudent) { |
| | | String lateralSurface = tStudent.getImage1()+";"+tStudent.getImage2()+";"+tStudent.getImage3(); |
| | | List<String> strings = new ArrayList<>(); |
| | | if (!tStudent.getImage1().isEmpty()){ |
| | | strings.add(tStudent.getImage1()); |
| | | } |
| | | if (!tStudent.getImage2().isEmpty()){ |
| | | strings.add(tStudent.getImage2()); |
| | | } |
| | | if (!tStudent.getImage3().isEmpty()){ |
| | | strings.add(tStudent.getImage3()); |
| | | } |
| | | String result = String.join(";", strings); |
| | | |
| | | System.out.println("=======lateralSurface======>?"+lateralSurface); |
| | | tStudent.setLateralSurface(lateralSurface); |
| | | System.out.println("学员体测表的值"+lateralSurface); |
| | | |
| | | // |
| | | // String lateralSurface = tStudent.getImage1()+";"+tStudent.getImage2()+";"+tStudent.getImage3(); |
| | | // |
| | | // System.out.println("=======lateralSurface======>?"+lateralSurface); |
| | | tStudent.setLateralSurface(result); |
| | | System.out.println("学员体测表的值"+result); |
| | | itStudentService.update(tStudent); |
| | | // appUserClient.updateStudent(tStudent); |
| | | return new ResultUtil(0,0,"编辑成功"); |
| | |
| | | |
| | | updateTimeDto updateTimeDto =new updateTimeDto(date1,id); |
| | | System.out.println("======updateTimeDto=====>"+updateTimeDto); |
| | | courseStuddentClient.updateUseDate(updateTimeDto); |
| | | // courseStuddentClient.updateUseDate(updateTimeDto); |
| | | |
| | | studentClient.update(updateTimeDto); |
| | | |
| | | |
| | | CreateHistoryDto historyDto = new CreateHistoryDto(); |
| | |
| | | System.out.println("========ToHoliDto========="+resultUtil); |
| | | |
| | | |
| | | if (resultUtil==""||resultUtil==null){ |
| | | return new ResultUtil<>(0,0,"报名成功"); |
| | | if (resultUtil.equals("报名成功")){ |
| | | return new ResultUtil<>(0,0,resultUtil); |
| | | }else{ |
| | | return new ResultUtil<>(0,0,"报名成功,以下学员剩余课时不足"+resultUtil);} |
| | | return new ResultUtil<>(0,1,resultUtil);} |
| | | |
| | | } |
| | | |
| | |
| | | String resultUtil = courseStuddentClient.toTrans(toHoliDto); |
| | | System.out.println("========ToHoliDto========="+resultUtil); |
| | | |
| | | if (resultUtil.equals("换课成功")) { |
| | | return new ResultUtil<>(0,0,resultUtil); |
| | | |
| | | if (resultUtil==""){ |
| | | return new ResultUtil<>(0,0,"报名成功"); |
| | | }else{ |
| | | return new ResultUtil<>(0,0,"报名成功,以下学员剩余课时不足"+resultUtil);} |
| | | }else { |
| | | return new ResultUtil<>(0,1,resultUtil); |
| | | } |
| | | } |
| | | |
| | | |
| | | //赠课 |
| | | |
| | | @RequestMapping(value = "/giftTo") |