| | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.sales.dto.SalesLedgerDto; |
| | | import com.ruoyi.sales.pojo.SalesLedger; |
| | | import com.ruoyi.sales.service.ISalesLedgerService; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | |
| | | } |
| | | |
| | | /** |
| | | * 查询销售台账和产品父子列表 |
| | | */ |
| | | @GetMapping("/getSalesLedgerWithProducts") |
| | | public TableDataInfo getSalesLedgerWithProducts() |
| | | { |
| | | startPage(); |
| | | List<SalesLedgerDto> list = salesLedgerService.getSalesLedgerWithProducts(); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | /** |
| | | * 导出销售台账列表 |
| | | */ |
| | | @Log(title = "销售台账", businessType = BusinessType.EXPORT) |
| | |
| | | } |
| | | |
| | | /** |
| | | * 新增销售台账 |
| | | * 新增修改销售台账 |
| | | */ |
| | | @Log(title = "销售台账", businessType = BusinessType.INSERT) |
| | | @PostMapping ("/insertSalesLedger") |
| | | @PostMapping ("/addOrUpdateSalesLedger") |
| | | public AjaxResult add(@RequestBody SalesLedger salesLedger) |
| | | { |
| | | return toAjax(salesLedgerService.insertSalesLedger(salesLedger)); |
| | | } |
| | | |
| | | /** |
| | | * 修改销售台账 |
| | | */ |
| | | @Log(title = "销售台账", businessType = BusinessType.UPDATE) |
| | | @PostMapping ("/updateSalesLedger") |
| | | public AjaxResult edit(@RequestBody SalesLedger salesLedger) |
| | | { |
| | | return toAjax(salesLedgerService.updateSalesLedger(salesLedger)); |
| | | return toAjax(salesLedgerService.addOrUpdateSalesLedger(salesLedger)); |
| | | } |
| | | |
| | | /** |
| | | * 删除销售台账 |
| | | */ |
| | | @Log(title = "销售台账", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{ids}") |
| | | public AjaxResult remove(@PathVariable Long[] ids) |
| | | @DeleteMapping("/delLedger") |
| | | public AjaxResult remove(@RequestBody Long[] ids) |
| | | { |
| | | if (ids == null || ids.length == 0) { |
| | | return AjaxResult.error("请传入要删除的ID"); |
| | | } |
| | | return toAjax(salesLedgerService.deleteSalesLedgerByIds(ids)); |
| | | } |
| | | } |