|
@@ -2,20 +2,25 @@ package com.ruoyi.web.work.controller;
|
|
|
|
|
|
import com.ruoyi.common.annotation.Log;
|
|
|
import com.ruoyi.common.core.controller.BaseController;
|
|
|
-import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
import com.ruoyi.common.core.page.TableDataInfo;
|
|
|
import com.ruoyi.common.enums.BusinessType;
|
|
|
+import com.ruoyi.common.utils.PageUtils;
|
|
|
+import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
|
import com.ruoyi.web.work.domain.Packages;
|
|
|
import com.ruoyi.web.work.service.IPackagesService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
-import org.springframework.web.bind.annotation.*;
|
|
|
+import org.springframework.web.bind.annotation.GetMapping;
|
|
|
+import org.springframework.web.bind.annotation.PostMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
-import java.util.Arrays;
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
|
* 接包管理
|
|
|
+ *
|
|
|
* @author lsw
|
|
|
* @date 2024-04-19
|
|
|
*/
|
|
@@ -27,36 +32,21 @@ public class PackagesController extends BaseController {
|
|
|
|
|
|
@PreAuthorize("@ss.hasPermi('work:packages:list')")
|
|
|
@GetMapping("/list")
|
|
|
- public TableDataInfo list(Packages packages){
|
|
|
+ public TableDataInfo list(Packages packages) {
|
|
|
+ packages.setCompanyId(getLoginUser().getUser().getCompanyId());
|
|
|
startPage();
|
|
|
List<Packages> list = packagesService.selectList(packages);
|
|
|
return getDataTable(list);
|
|
|
}
|
|
|
|
|
|
- @PreAuthorize("@ss.hasPermi('work:packages:query')")
|
|
|
- @GetMapping(value = "/detail/{id}")
|
|
|
- public AjaxResult detail(@PathVariable("id") Long id){
|
|
|
- return AjaxResult.success(packagesService.getById(id));
|
|
|
- }
|
|
|
-
|
|
|
- @PreAuthorize("@ss.hasPermi('work:packages:add')")
|
|
|
- @Log(title = "接包管理", businessType = BusinessType.INSERT)
|
|
|
- @PostMapping("/add")
|
|
|
- public AjaxResult add(@RequestBody Packages packages){
|
|
|
- return toAjax(packagesService.save(packages));
|
|
|
- }
|
|
|
-
|
|
|
- @PreAuthorize("@ss.hasPermi('work:packages:edit')")
|
|
|
- @Log(title = "接包管理", businessType = BusinessType.UPDATE)
|
|
|
- @PostMapping("/edit")
|
|
|
- public AjaxResult edit(@RequestBody Packages packages){
|
|
|
- return toAjax(packagesService.updateById(packages));
|
|
|
- }
|
|
|
-
|
|
|
- @PreAuthorize("@ss.hasPermi('work:packages:remove')")
|
|
|
- @Log(title = "接包管理", businessType = BusinessType.DELETE)
|
|
|
- @GetMapping("/remove/{ids}")
|
|
|
- public AjaxResult remove(@PathVariable Long[] ids){
|
|
|
- return toAjax(packagesService.removeByIds(Arrays.asList(ids)));
|
|
|
+ @Log(title = "导出接包用户信息", businessType = BusinessType.EXPORT)
|
|
|
+ @PreAuthorize("@ss.hasPermi('work:packages:list')")
|
|
|
+ @PostMapping("/export")
|
|
|
+ public void export(HttpServletResponse response, Packages packages) {
|
|
|
+ packages.setCompanyId(getLoginUser().getUser().getCompanyId());
|
|
|
+ PageUtils.orderBy("p.id desc");
|
|
|
+ List<Packages> list = packagesService.selectList(packages);
|
|
|
+ ExcelUtil<Packages> util = new ExcelUtil<Packages>(Packages.class);
|
|
|
+ util.exportExcel(response, list, "用户信息");
|
|
|
}
|
|
|
}
|