| | |
| | | import com.dsh.course.feignclient.account.model.AppUser; |
| | | import com.dsh.course.feignclient.account.model.Student; |
| | | import com.dsh.course.feignclient.account.model.TCourseInfoRecord; |
| | | import com.dsh.course.feignclient.activity.CouponClient; |
| | | import com.dsh.course.feignclient.activity.model.Coupon; |
| | | import com.dsh.course.feignclient.model.*; |
| | | import com.dsh.course.feignclient.other.StoreClient; |
| | | import com.dsh.course.feignclient.other.model.Store; |
| | |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import net.bytebuddy.asm.Advice; |
| | | import org.aspectj.weaver.ast.Var; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.BeanUtils; |
| | |
| | | |
| | | @Autowired |
| | | private RestTemplate internalRestTemplate; |
| | | |
| | | |
| | | @Autowired |
| | | private CouponClient couponClient; |
| | | @Autowired |
| | | private StoreClient storeClient; |
| | | @Autowired |
| | | private TCoursePackageDiscountService discountService; |
| | | private final SimpleDateFormat format = new SimpleDateFormat("MM-dd HH:mm"); |
| | | |
| | | /** |
| | | * 手动支付 |
| | | * @return |
| | | */ |
| | | @RequestMapping("/base/coursePackagePayment/changeState") |
| | | public Object changeState(@RequestBody CoursePackagePayDTO dto){ |
| | | |
| | | return packagePaymentService.changeState(dto); |
| | | } |
| | | /** |
| | | * 获取购课记录 |
| | | */ |
| | | @ResponseBody |
| | | @RequestMapping("/coursePackagePayment/listAll") |
| | | public List<CoursePackagePaymentVO> listAll(@RequestBody CoursePackagePaymentQuery query){ |
| | | List<CoursePackagePaymentVO> res = packagePaymentService.listAll(query); |
| | | List<CoursePackagePaymentVO> result = new ArrayList<>(); |
| | | for (CoursePackagePaymentVO re : res) { |
| | | if (re.getCashPayment()==null){ |
| | | String value = String.valueOf(re.getPlayPaiCoin()); |
| | | re.setCashPayment(new BigDecimal(value)); |
| | | } |
| | | |
| | | Store store = storeClient.queryStoreById(re.getStoreId()); |
| | | AppUser appUser = appUserClient.queryAppUser(re.getAppUserId()); |
| | | Student student = studentClient.queryStudentById(re.getStudentId()); |
| | | re.setPayStudent(student.getName()); |
| | | re.setPayUser(appUser.getName()); |
| | | re.setPhone(appUser.getPhone()); |
| | | re.setStoreName(store.getName()); |
| | | if (query.getPayUser()== null || query.getPayUser().equals("") ){ |
| | | }else{ |
| | | List<AppUser> appUsers = appUserClient.queryAppUserListByName(query.getPayUser()); |
| | | for (AppUser user : appUsers) { |
| | | if (appUser.getName().equals(user.getName())){ |
| | | result.add(re); |
| | | } |
| | | } |
| | | } |
| | | if (query.getPayStudent()== null || query.getPayStudent().equals("")){ |
| | | }else{ |
| | | List<Student> students = studentClient.queryStudentListByName(query.getPayStudent()); |
| | | for (Student student1 : students) { |
| | | if (student.getName().equals(student1.getName())){ |
| | | result.add(re); |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (re.getPayType()==1){ |
| | | re.setBuyTypeName("微信支付"); |
| | | }else if(re.getPayType()==2){ |
| | | re.setBuyTypeName("支付宝支付"); |
| | | }else if(re.getPayType()==3){ |
| | | re.setBuyTypeName("玩湃币支付"); |
| | | }else if(re.getPayType()==4){ |
| | | re.setBuyTypeName("积分支付"); |
| | | }else if(re.getPayType()==5){ |
| | | re.setBuyTypeName("积分+微信支付"); |
| | | }else if(re.getPayType()==6){ |
| | | re.setBuyTypeName("积分+支付宝支付"); |
| | | }else if(re.getPayType()==7){ |
| | | re.setBuyTypeName("手动支付"+"-"+re.getBuyTypeName()); |
| | | } |
| | | // 如果支付用户类型为平台 则购买方式则为1线下购买 |
| | | if (re.getPayUserType()== 2){ |
| | | re.setBuyType(1); |
| | | }else{ |
| | | // 如果当前课包有折扣 则为3折扣购买 |
| | | if (discountService.list(new QueryWrapper<TCoursePackageDiscount>() |
| | | .eq("coursePackageId",re.getCoursePackageId()).eq("auditStatus",2)).size()>0){ |
| | | re.setBuyType(3); |
| | | re.setDiscountAmount(re.getOriginalPrice().subtract(re.getPayMoney())); |
| | | }else{ |
| | | re.setBuyType(2); |
| | | } |
| | | } |
| | | // 不为空则计算 |
| | | if (re.getUserCouponId()!=null){ |
| | | |
| | | } |
| | | // todo 计算优惠金额 |
| | | // Coupon coupon = couponClient.queryCouponById(re.getUserCouponId().intValue()); |
| | | } |
| | | if (query.getPayStudent()== null || query.getPayStudent().equals("")){ |
| | | if (query.getPayUser()== null || query.getPayUser().equals("")){ |
| | | return res; |
| | | }else{ |
| | | return result; |
| | | } |
| | | }else{ |
| | | return result; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取 没有学员信息的图片配置 |
| | | * @param stuId 学员id |
| | | * @return 课包列表 |