| | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.commons.collections.CollectionUtils; |
| | | import org.assertj.core.util.Arrays; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @CrossOrigin(origins = "*") |
| | |
| | | private ShoppingGoodsDao shoppingGoodsDao; |
| | | @Resource |
| | | private SysStoreInfoDao sysStoreInfoDao; |
| | | @Resource |
| | | private SysWorktimeService worktimeService; |
| | | |
| | | /** |
| | | * 获取用户所有可用的项目和套餐 |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "获取用户所有可用的项目和套餐", notes = "获取用户所有可用的项目和套餐") |
| | | @GetMapping(value = "/getUserProjInfo/{id}") |
| | | @GetMapping(value = "/getUserProjInfo/{vipId}") |
| | | public AjaxResult getUserProjInfo(@PathVariable("vipId")Long vipId) { |
| | | AjaxResult result = AjaxResult.buildSuccessInstance("查询成功"); |
| | | |
| | |
| | | } |
| | | if(ObjectUtil.isNotEmpty(orderListDto.getQueryKey())){ |
| | | projService.setQueryKey(orderListDto.getQueryKey()); |
| | | } |
| | | if(StrUtil.isNotEmpty(orderListDto.getState())){ |
| | | projService.setState(orderListDto.getState()); |
| | | } |
| | | QueryUtil.setQueryLimitCom(projService); |
| | | List<SysProjServices> dataList = projServicesSerivce.findInPage(projService, pageVo); |
| | |
| | | return new AjaxResult(AjaxResult.STATUS_SUCCESS, staffs, 0); |
| | | } |
| | | |
| | | /** |
| | | * 获取配料师 |
| | | */ |
| | | @ApiOperation(value = "获取配料师", notes = "获取配料师") |
| | | @GetMapping(value = "/getShopStaffByRoleName") |
| | | public AjaxResult getStaffByRoleName() { |
| | | return new AjaxResult(AjaxResult.STATUS_SUCCESS, sysUsersService.findByRoleName(true, "配料师")); |
| | | } |
| | | |
| | | /** |
| | | * 获取工作时间 |
| | | */ |
| | | @ApiOperation(value = "获取工作时间", notes = "获取工作时间") |
| | | @GetMapping(value = "/getWorkTime") |
| | | public AjaxResult getWorkTime() { |
| | | Long shopId = getMe().getShopId(); |
| | | Date minTime = worktimeService.findMinTime(shopId); |
| | | Date maxTime = worktimeService.findMaxTime(shopId); |
| | | if (minTime == null || maxTime == null) { |
| | | return AjaxResult.buildFailInstance("门店没有班次信息,请先设置门店班次"); |
| | | } else { |
| | | return AjaxResult.buildSuccessInstance(java.util.Arrays.asList( |
| | | DateUtil.dateToString(minTime, "HH:mm"), |
| | | DateUtil.dateToString(maxTime, "HH:mm"))); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 新增项目 |
| | |
| | | } |
| | | SysProjServices newSysProjServices = sysProjServicesService.addSysProjServices(sysProjServices); |
| | | if (newSysProjServices != null) { |
| | | return AjaxResult.buildSuccessInstance(Arrays.asList(newSysProjServices)); |
| | | AjaxResult result = AjaxResult.buildSuccessInstance("下单成功!"); |
| | | result.putInMap("newSysProjServices", newSysProjServices); |
| | | return result; |
| | | } else { |
| | | return new AjaxResult(AjaxResult.STATUS_FAIL, "下单失败!"); |
| | | } |