| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.api.R; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.dsh.course.feignClient.account.AppUserClient; |
| | | import com.dsh.course.feignClient.account.StudentClient; |
| | | import com.dsh.course.feignClient.account.model.TAppUser; |
| | | import com.dsh.course.feignClient.activity.HuiminCardClient; |
| | | import com.dsh.course.feignClient.activity.model.THuiminCard; |
| | | import com.dsh.guns.config.UserExt; |
| | |
| | | private TOperatorService operatorService; |
| | | @Autowired |
| | | private ITSiteService tSiteService; |
| | | @Autowired |
| | | private AppUserClient appUserClient; |
| | | @Autowired |
| | | private StudentClient studentClient; |
| | | |
| | | |
| | | /** |
| | | * 跳转到玩湃惠民卡首页 |
| | |
| | | model.addAttribute("objectType", user.getObjectType()); |
| | | return PREFIX + "tHuiminCard_detail.html"; |
| | | } |
| | | /** |
| | | * 跳转到订单录入页面 |
| | | */ |
| | | @RequestMapping("/tHuiminCardAddOrder") |
| | | public String tHuiminCardAddOrder(Model model) { |
| | | Integer objectType = UserExt.getUser().getObjectType(); |
| | | Integer objectId = UserExt.getUser().getObjectId(); |
| | | model.addAttribute("role", objectType); |
| | | if (objectType==1){ |
| | | List<TOperator> list = operatorService.list(new LambdaQueryWrapper<TOperator>() |
| | | .eq(TOperator::getState, 1)); |
| | | model.addAttribute("operators", list); |
| | | }else if (objectType==2){ |
| | | List<TStore> list = storeService.list(new LambdaQueryWrapper<TStore>() |
| | | .eq(TStore::getOperatorId, objectId)); |
| | | model.addAttribute("stores", list); |
| | | }else{ |
| | | List<THuiminCard> cards = huiminCardClient.getCards(objectId + ""); |
| | | model.addAttribute("cards", cards); |
| | | } |
| | | return PREFIX + "tHuiminCard_addOrder.html"; |
| | | } |
| | | @RequestMapping("/addPayHuiMing") |
| | | @ResponseBody |
| | | public Object addPayHuiMing(Integer studentId,Integer cardId) { |
| | | |
| | | huiminCardClient.addPayHuiMing(studentId ,cardId); |
| | | |
| | | return 200; |
| | | } |
| | | @RequestMapping(value = "/checkUser") |
| | | @ResponseBody |
| | | public Object checkUser(String phone) { |
| | | TAppUser appUserByPhone = appUserClient.getAppUserByPhone(phone); |
| | | if (appUserByPhone==null){ |
| | | return 500; |
| | | } |
| | | List<TStudent> tStudents = studentClient.queryStudentList(appUserByPhone.getId()); |
| | | if (tStudents.isEmpty()){ |
| | | return 501; |
| | | } |
| | | return tStudents; |
| | | } |
| | | @RequestMapping(value = "/getStores") |
| | | @ResponseBody |
| | | public Object getStores(String operatorId) { |
| | | if (operatorId.isEmpty()){ |
| | | return new ArrayList<>(); |
| | | }else{ |
| | | List<TStore> list = storeService.lambdaQuery().eq(TStore::getOperatorId, operatorId).list(); |
| | | return list; |
| | | } |
| | | |
| | | } |
| | | @RequestMapping(value = "/getCards") |
| | | @ResponseBody |
| | | public Object getCards(String storeId) { |
| | | List<THuiminCard> list = huiminCardClient.getCards(storeId); |
| | | return list; |
| | | } |
| | | /** |
| | | * 获取玩湃惠民卡详情 |
| | | */ |