瀏覽代碼

[CODE]:协议管理

maxianghua 4 年之前
父節點
當前提交
a83a501893

+ 99 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/warehouse/agreement/TWarehouseAgreementStorageController.java

@@ -0,0 +1,99 @@
+package com.ruoyi.web.controller.warehouse.agreement;
+
+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.domain.model.LoginUser;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.common.utils.ServletUtils;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.utils.spring.SpringUtils;
+import com.ruoyi.framework.web.service.TokenService;
+import com.ruoyi.warehouseBusiness.domain.TWarehouseAgreement;
+import com.ruoyi.warehouseBusiness.service.ITWarehouseAgreementService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 仓储费Controller
+ *
+ * @author ruoyi
+ * @date 2020-12-11
+ */
+@RestController
+@RequestMapping("/warehouseBusiness/agreementStorage")
+public class TWarehouseAgreementStorageController extends BaseController {
+    @Autowired
+    private ITWarehouseAgreementService tWarehouseAgreementService;
+
+    /**
+     * 查询仓储费列表
+     */
+    @PreAuthorize("@ss.hasPermi('warehouseBusiness:agreementStorage:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(TWarehouseAgreement tWarehouseAgreement) {
+        startPage();
+        tWarehouseAgreement.setfFeetypeid((long) 0);
+        List<Map<String, Object>> list = tWarehouseAgreementService.selectTWarehouseAgreementList1(tWarehouseAgreement);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出仓储费列表
+     */
+    @PreAuthorize("@ss.hasPermi('warehouseBusiness:agreementStorage:export')")
+    @Log(title = "仓储费", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(TWarehouseAgreement tWarehouseAgreement) {
+        List<TWarehouseAgreement> list = tWarehouseAgreementService.selectTWarehouseAgreementList(tWarehouseAgreement);
+        ExcelUtil<TWarehouseAgreement> util = new ExcelUtil<TWarehouseAgreement>(TWarehouseAgreement.class);
+        return util.exportExcel(list, "agreement");
+    }
+
+    /**
+     * 获取仓储费详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('warehouseBusiness:agreementStorage:query')")
+    @GetMapping(value = "/{fId}")
+    public AjaxResult getInfo(@PathVariable("fId") Long fId) {
+        return AjaxResult.success(tWarehouseAgreementService.selectTWarehouseAgreementById(fId));
+    }
+
+    /**
+     * 新增仓储费
+     */
+    @PreAuthorize("@ss.hasPermi('warehouseBusiness:agreementStorage:add')")
+    @Log(title = "仓储费", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestParam("agreement") String agreement,
+                          @RequestParam("agreementitems") String agreementitems) {
+        // 获取当前的用户
+        LoginUser loginUser = SpringUtils.getBean(TokenService.class).getLoginUser(ServletUtils.getRequest());
+        return tWarehouseAgreementService.insertTWarehouseAgreement(agreement,agreementitems,loginUser);
+    }
+
+    /**
+     * 修改仓储费
+     */
+    @PreAuthorize("@ss.hasPermi('warehouseBusiness:agreementStorage:edit')")
+    @Log(title = "仓储费", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody TWarehouseAgreement tWarehouseAgreement) {
+        return toAjax(tWarehouseAgreementService.updateTWarehouseAgreement(tWarehouseAgreement));
+    }
+
+    /**
+     * 删除仓储费
+     */
+    @PreAuthorize("@ss.hasPermi('warehouseBusiness:agreementStorage:remove')")
+    @Log(title = "仓储费", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{fIds}")
+    public AjaxResult remove(@PathVariable Long[] fIds) {
+        return toAjax(tWarehouseAgreementService.deleteTWarehouseAgreementByIds(fIds));
+    }
+}

+ 21 - 12
ruoyi-admin/src/main/java/com/ruoyi/web/controller/warehouse/warehouseBusiness/TWarehouseAgreementController.java → ruoyi-admin/src/main/java/com/ruoyi/web/controller/warehouse/agreement/TWarehouseAgreementTaskController.java

@@ -1,11 +1,15 @@
-package com.ruoyi.web.controller.warehouse.warehouseBusiness;
+package com.ruoyi.web.controller.warehouse.agreement;
 
 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.domain.model.LoginUser;
 import com.ruoyi.common.core.page.TableDataInfo;
 import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.common.utils.ServletUtils;
 import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.utils.spring.SpringUtils;
+import com.ruoyi.framework.web.service.TokenService;
 import com.ruoyi.warehouseBusiness.domain.TWarehouseAgreement;
 import com.ruoyi.warehouseBusiness.service.ITWarehouseAgreementService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -13,6 +17,7 @@ import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * 仓储费Controller
@@ -21,26 +26,27 @@ import java.util.List;
  * @date 2020-12-11
  */
 @RestController
-@RequestMapping("/warehouseBusiness/agreement")
-public class TWarehouseAgreementController extends BaseController {
+@RequestMapping("/warehouseBusiness/agreementTask")
+public class TWarehouseAgreementTaskController extends BaseController {
     @Autowired
     private ITWarehouseAgreementService tWarehouseAgreementService;
 
     /**
      * 查询仓储费列表
      */
-    @PreAuthorize("@ss.hasPermi('warehouseBusiness:agreement:list')")
+    @PreAuthorize("@ss.hasPermi('warehouseBusiness:agreementTask:list')")
     @GetMapping("/list")
     public TableDataInfo list(TWarehouseAgreement tWarehouseAgreement) {
         startPage();
-        List<TWarehouseAgreement> list = tWarehouseAgreementService.selectTWarehouseAgreementList(tWarehouseAgreement);
+        tWarehouseAgreement.setfFeetypeid((long) 0);
+        List<Map<String, Object>> list = tWarehouseAgreementService.selectTWarehouseAgreementList1(tWarehouseAgreement);
         return getDataTable(list);
     }
 
     /**
      * 导出仓储费列表
      */
-    @PreAuthorize("@ss.hasPermi('warehouseBusiness:agreement:export')")
+    @PreAuthorize("@ss.hasPermi('warehouseBusiness:agreementTask:export')")
     @Log(title = "仓储费", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public AjaxResult export(TWarehouseAgreement tWarehouseAgreement) {
@@ -52,7 +58,7 @@ public class TWarehouseAgreementController extends BaseController {
     /**
      * 获取仓储费详细信息
      */
-    @PreAuthorize("@ss.hasPermi('warehouseBusiness:agreement:query')")
+    @PreAuthorize("@ss.hasPermi('warehouseBusiness:agreementTask:query')")
     @GetMapping(value = "/{fId}")
     public AjaxResult getInfo(@PathVariable("fId") Long fId) {
         return AjaxResult.success(tWarehouseAgreementService.selectTWarehouseAgreementById(fId));
@@ -61,17 +67,20 @@ public class TWarehouseAgreementController extends BaseController {
     /**
      * 新增仓储费
      */
-    @PreAuthorize("@ss.hasPermi('warehouseBusiness:agreement:add')")
+    @PreAuthorize("@ss.hasPermi('warehouseBusiness:agreementTask:add')")
     @Log(title = "仓储费", businessType = BusinessType.INSERT)
     @PostMapping
-    public AjaxResult add(@RequestBody TWarehouseAgreement tWarehouseAgreement) {
-        return toAjax(tWarehouseAgreementService.insertTWarehouseAgreement(tWarehouseAgreement));
+    public AjaxResult add(@RequestParam("agreement") String agreement,
+                          @RequestParam("agreementitems") String agreementitems) {
+        // 获取当前的用户
+        LoginUser loginUser = SpringUtils.getBean(TokenService.class).getLoginUser(ServletUtils.getRequest());
+        return tWarehouseAgreementService.insertTWarehouseAgreement(agreement,agreementitems,loginUser);
     }
 
     /**
      * 修改仓储费
      */
-    @PreAuthorize("@ss.hasPermi('warehouseBusiness:agreement:edit')")
+    @PreAuthorize("@ss.hasPermi('warehouseBusiness:agreementTask:edit')")
     @Log(title = "仓储费", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody TWarehouseAgreement tWarehouseAgreement) {
@@ -81,7 +90,7 @@ public class TWarehouseAgreementController extends BaseController {
     /**
      * 删除仓储费
      */
-    @PreAuthorize("@ss.hasPermi('warehouseBusiness:agreement:remove')")
+    @PreAuthorize("@ss.hasPermi('warehouseBusiness:agreementTask:remove')")
     @Log(title = "仓储费", businessType = BusinessType.DELETE)
     @DeleteMapping("/{fIds}")
     public AjaxResult remove(@PathVariable Long[] fIds) {

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/warehouse/warehouseBusiness/TWarehouseAgreementitemsController.java → ruoyi-admin/src/main/java/com/ruoyi/web/controller/warehouse/agreement/TWarehouseAgreementitemsController.java

@@ -1,4 +1,4 @@
-package com.ruoyi.web.controller.warehouse.warehouseBusiness;
+package com.ruoyi.web.controller.warehouse.agreement;
 
 import com.ruoyi.common.annotation.Log;
 import com.ruoyi.common.core.controller.BaseController;