| | |
| | | import com.dsh.guns.config.UserExt; |
| | | import com.dsh.guns.core.base.controller.BaseController; |
| | | import com.dsh.guns.modular.system.model.*; |
| | | import com.dsh.guns.modular.system.model.TCoursePackagePayment; |
| | | import com.dsh.guns.modular.system.service.ICityService; |
| | | import com.dsh.guns.modular.system.service.ICoursePackageService; |
| | | import com.dsh.guns.modular.system.service.IStoreService; |
| | |
| | | import org.springframework.ui.Model; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.math.BigDecimal; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * 广告管理控制器 |
| | |
| | | private CoursePackagePaymentConfigClient coursePackagePaymentConfigClient; |
| | | @Autowired |
| | | private CoursePackageClient coursePackageClient; |
| | | @Autowired |
| | | private SiteClient siteClient; |
| | | |
| | | /** |
| | | * 跳转到购课记录页面 |
| | | */ |
| | |
| | | * 添加购课记录 |
| | | */ |
| | | @ResponseBody |
| | | @RequestMapping(value = "/addCoursePackagePayment") |
| | | public ResultUtil addCoach(@RequestBody TCoursePackagePayment tCoursePackagePayment) { |
| | | @PostMapping(value = "/addCoursePackagePayment/{id}") |
| | | public ResultUtil addCoach(@RequestBody TCoursePackagePayment tCoursePackagePayment, @PathVariable("id")Integer id) { |
| | | Integer objectId = UserExt.getUser().getObjectId(); |
| | | Integer objectType = UserExt.getUser().getObjectType(); |
| | | String name = UserExt.getUser().getName(); |
| | | tCoursePackagePayment.setPayUserId(objectId); |
| | | // 获取课包id |
| | | Integer coursePackageId = tCoursePackagePayment.getCoursePackageId(); |
| | | |
| | | List<TCoursePackageDiscount> list = coursePackageDiscountClient.queryByCoursePackageId(coursePackageId); |
| | | TCoursePackageDiscount tCoursePackageDiscount1 = list.get(0); |
| | | Integer coursePackagePaymentConfigId = tCoursePackageDiscount1.getCoursePackagePaymentConfigId(); |
| | | List<CoursePackagePaymentConfig> coursePackagePaymentConfigs = coursePackagePaymentConfigClient.queryCoursePackagePaymentConfigList(coursePackageId); |
| | | // 获取siteId 判断预约人数 |
| | | // todo |
| | | |
| | | // 获取当前课包价格配置 |
| | | CoursePackagePaymentConfig coursePackagePaymentConfigs = coursePackagePaymentConfigClient.getById(id); |
| | | Integer coursePackageId1 = tCoursePackagePayment.getCoursePackageId(); |
| | | TCoursePackage tCoursePackage = coursePackageClient.queryById(coursePackageId1); |
| | | Integer siteId = tCoursePackage.getSiteId(); |
| | | // tCoursePackagePayment.setCashPayment(); |
| | | // tCoursePackagePayment.setPlayPaiCoin(); |
| | | Double cashPayment = coursePackagePaymentConfigs.getCashPayment(); |
| | | String c1 = Double.toString(cashPayment); |
| | | BigDecimal bigDecimal = new BigDecimal(c1); |
| | | tCoursePackagePayment.setCashPayment(bigDecimal); |
| | | Date currentDate = new Date(); |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(currentDate); |
| | | calendar.add(Calendar.DAY_OF_MONTH, 20); |
| | | Date updatedDate = calendar.getTime(); |
| | | tCoursePackagePayment.setOriginalPrice(cashPayment); |
| | | tCoursePackagePayment.setUseTime(updatedDate); |
| | | tCoursePackagePayment.setPlayPaiCoin(coursePackagePaymentConfigs.getPlayPaiCoin()); |
| | | coursePackagePaymentClient.addCoursePackagePayment(tCoursePackagePayment); |
| | | return ResultUtil.success("添加成功"); |
| | | } |
| | | /** |
| | |
| | | } |
| | | |
| | | /** |
| | | * 获取列表 |
| | | * 手动支付 |
| | | */ |
| | | @RequestMapping(value = "/pay") |
| | | @ResponseBody |
| | |
| | | return storeClient.getStore(city); |
| | | } |
| | | |
| | | /** |
| | | * 根据课包id 获取课时规格 |
| | | */ |
| | | @RequestMapping(value = "/getCoursePackageConfig") |
| | | @ResponseBody |
| | | public List<CoursePackagePaymentConfig> getCoursePackageConfig(Integer id) { |
| | | return coursePackagePaymentConfigClient.queryCoursePackagePaymentConfigList(id); |
| | | } |
| | | |
| | | } |
| | | |