|
@@ -0,0 +1,115 @@
|
|
|
+package com.ruoyi.web.controller.shipping.controller.basicData;
|
|
|
+
|
|
|
+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.StringUtils;
|
|
|
+import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
|
+import com.ruoyi.shipping.domain.TAddress;
|
|
|
+import com.ruoyi.shipping.service.ITAddressService;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 地点基础信息(港口 码头 堆场 航线)Controller
|
|
|
+ *
|
|
|
+ * @author ruoyi
|
|
|
+ * @date 2021-03-22
|
|
|
+ */
|
|
|
+@RestController
|
|
|
+@RequestMapping("/shipping/route")
|
|
|
+public class RouteController extends BaseController
|
|
|
+{
|
|
|
+ @Autowired
|
|
|
+ private ITAddressService tAddressService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询地点基础信息(港口 码头 堆场 航线)列表
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('shipping:route:list')")
|
|
|
+ @GetMapping("/list")
|
|
|
+ public TableDataInfo list(TAddress tAddress)
|
|
|
+ {
|
|
|
+ startPage();
|
|
|
+ tAddress.setfTypes("4");
|
|
|
+ List<TAddress> list = tAddressService.selectTAddressList(tAddress);
|
|
|
+ return getDataTable(list);
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping("/query")
|
|
|
+ public TableDataInfo query(TAddress tAddress)
|
|
|
+ {
|
|
|
+ startPage();
|
|
|
+ tAddress.setfTypes("4");
|
|
|
+ List<TAddress> list = tAddressService.selectTAddressList(tAddress);
|
|
|
+ return getDataTable(list);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 导出地点基础信息(港口 码头 堆场 航线)列表
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('shipping:route:export')")
|
|
|
+ @Log(title = "地点基础信息(港口 码头 堆场 航线)", businessType = BusinessType.EXPORT)
|
|
|
+ @GetMapping("/export")
|
|
|
+ public AjaxResult export(TAddress tAddress)
|
|
|
+ {
|
|
|
+ List<TAddress> list = tAddressService.selectTAddressList(tAddress);
|
|
|
+ ExcelUtil<TAddress> util = new ExcelUtil<TAddress>(TAddress.class);
|
|
|
+ return util.exportExcel(list, "address");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取地点基础信息(港口 码头 堆场 航线)详细信息
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('shipping:route:query')")
|
|
|
+ @GetMapping(value = "/{fId}")
|
|
|
+ public AjaxResult getInfo(@PathVariable("fId") Long fId)
|
|
|
+ {
|
|
|
+ return AjaxResult.success(tAddressService.selectTAddressById(fId));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新增地点基础信息(港口 码头 堆场 航线)
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('shipping:route:add')")
|
|
|
+ @Log(title = "地点基础信息(港口 码头 堆场 航线)", businessType = BusinessType.INSERT)
|
|
|
+ @PostMapping
|
|
|
+ public AjaxResult add(@RequestBody TAddress tAddress)
|
|
|
+ {
|
|
|
+ if (StringUtils.isEmpty(tAddress.getfNo())){
|
|
|
+ return AjaxResult.error("航线编号不能为空");
|
|
|
+ }
|
|
|
+ if (StringUtils.isEmpty(tAddress.getfName())){
|
|
|
+ return AjaxResult.error("航线名称不能为空");
|
|
|
+ }
|
|
|
+ tAddress.setfTypes("4");
|
|
|
+ return toAjax(tAddressService.insertTAddress(tAddress));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 修改地点基础信息(港口 码头 堆场 航线)
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('shipping:route:edit')")
|
|
|
+ @Log(title = "地点基础信息(港口 码头 堆场 航线)", businessType = BusinessType.UPDATE)
|
|
|
+ @PutMapping
|
|
|
+ public AjaxResult edit(@RequestBody TAddress tAddress)
|
|
|
+ {
|
|
|
+ return toAjax(tAddressService.updateTAddress(tAddress));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 删除地点基础信息(港口 码头 堆场 航线)
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('shipping:route:remove')")
|
|
|
+ @Log(title = "地点基础信息(港口 码头 堆场 航线)", businessType = BusinessType.DELETE)
|
|
|
+ @DeleteMapping("/{fIds}")
|
|
|
+ public AjaxResult remove(@PathVariable Long[] fIds)
|
|
|
+ {
|
|
|
+ return toAjax(tAddressService.deleteTAddressByIds(fIds));
|
|
|
+ }
|
|
|
+}
|