| | |
| | | import com.ruoyi.framework.web.service.TokenService; |
| | | import com.ruoyi.system.domain.TOrderSale; |
| | | import com.ruoyi.system.domain.TOrderSaleGoods; |
| | | import com.ruoyi.system.dto.CheckoutDTO; |
| | | import com.ruoyi.system.dto.TOrderSaleDTO; |
| | | import com.ruoyi.system.export.TOrderMealExportExcel; |
| | | import com.ruoyi.system.export.TOrderSaleExportExcel; |
| | |
| | | import org.apache.poi.ss.usermodel.Workbook; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.ServletOutputStream; |
| | |
| | | import java.net.URLEncoder; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @GetMapping(value = "/getDetailById") |
| | | public AjaxResult<TOrderSaleVO> getDetailById(@RequestParam(value = "id") Long id) { |
| | | TOrderSale orderSale = orderSaleService.getById(id); |
| | | if(Objects.isNull(orderSale)){ |
| | | return AjaxResult.error("未查询到销售单"); |
| | | } |
| | | TOrderSaleVO orderSaleVO = new TOrderSaleVO(); |
| | | BeanUtils.copyProperties(orderSale, orderSaleVO); |
| | | List<TOrderSaleGoods> list = orderSaleGoodsService.list(Wrappers.lambdaQuery(TOrderSaleGoods.class) |
| | |
| | | } |
| | | |
| | | /** |
| | | * 销售下单接口 |
| | | */ |
| | | @ApiOperation( value = "销售单修改接口") |
| | | @PostMapping(value = "/edit") |
| | | public AjaxResult<String> edit(@RequestBody TOrderSaleDTO dto) { |
| | | orderSaleService.edit(dto); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | @ApiOperation( value = "结账接口") |
| | | @PostMapping(value = "/checkout") |
| | | public AjaxResult<String> checkout(@Validated @RequestBody CheckoutDTO dto) { |
| | | orderSaleService.checkout(dto); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | /** |
| | | * 导出销售列表 |
| | | */ |
| | | @ApiOperation(value = "导出销售列表") |