Jelajahi Sumber

[CODE]: 航线、港口

maxianghua 4 tahun lalu
induk
melakukan
b83df47c56

+ 106 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/shipping/controller/basicData/PortController.java

@@ -0,0 +1,106 @@
+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/port")
+public class PortController extends BaseController
+{
+    @Autowired
+    private ITAddressService tAddressService;
+
+    /**
+     * 查询地点基础信息(港口 码头 堆场 航线)列表
+     */
+    @PreAuthorize("@ss.hasPermi('shipping:port:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(TAddress tAddress)
+    {
+        startPage();
+        tAddress.setfTypes("1");
+        List<TAddress> list = tAddressService.selectTAddressList(tAddress);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出地点基础信息(港口 码头 堆场 航线)列表
+     */
+    @PreAuthorize("@ss.hasPermi('shipping:port: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:port:query')")
+    @GetMapping(value = "/{fId}")
+    public AjaxResult getInfo(@PathVariable("fId") Long fId)
+    {
+        return AjaxResult.success(tAddressService.selectTAddressById(fId));
+    }
+
+    /**
+     * 新增地点基础信息(港口 码头 堆场 航线)
+     */
+    @PreAuthorize("@ss.hasPermi('shipping:port: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("1");
+        return toAjax(tAddressService.insertTAddress(tAddress));
+    }
+
+    /**
+     * 修改地点基础信息(港口 码头 堆场 航线)
+     */
+    @PreAuthorize("@ss.hasPermi('shipping:port:edit')")
+    @Log(title = "地点基础信息(港口 码头 堆场 航线)", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody TAddress tAddress)
+    {
+        return toAjax(tAddressService.updateTAddress(tAddress));
+    }
+
+    /**
+     * 删除地点基础信息(港口 码头 堆场 航线)
+     */
+    @PreAuthorize("@ss.hasPermi('shipping:port:remove')")
+    @Log(title = "地点基础信息(港口 码头 堆场 航线)", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{fIds}")
+    public AjaxResult remove(@PathVariable Long[] fIds)
+    {
+        return toAjax(tAddressService.deleteTAddressByIds(fIds));
+    }
+}

+ 115 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/shipping/controller/basicData/RouteController.java

@@ -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));
+    }
+}

+ 5 - 1
ruoyi-shipping/src/main/java/com/ruoyi/shipping/mapper/TAddressMapper.java

@@ -1,8 +1,10 @@
 package com.ruoyi.shipping.mapper;
 
-import java.util.List;
 import com.ruoyi.shipping.domain.TAddress;
 
+import java.util.List;
+import java.util.Map;
+
 /**
  * 地点基础信息(港口 码头 堆场 航线)Mapper接口
  * 
@@ -27,6 +29,8 @@ public interface TAddressMapper
      */
     public List<TAddress> selectTAddressList(TAddress tAddress);
 
+    public List<Map<String, Object>> selectTAddressListMap(TAddress tAddress);
+
     /**
      * 新增地点基础信息(港口 码头 堆场 航线)
      * 

+ 5 - 1
ruoyi-shipping/src/main/java/com/ruoyi/shipping/service/ITAddressService.java

@@ -1,8 +1,10 @@
 package com.ruoyi.shipping.service;
 
-import java.util.List;
 import com.ruoyi.shipping.domain.TAddress;
 
+import java.util.List;
+import java.util.Map;
+
 /**
  * 地点基础信息(港口 码头 堆场 航线)Service接口
  * 
@@ -27,6 +29,8 @@ public interface ITAddressService
      */
     public List<TAddress> selectTAddressList(TAddress tAddress);
 
+    public List<Map<String, Object>> selectTAddressListMap(TAddress tAddress);
+
     /**
      * 新增地点基础信息(港口 码头 堆场 航线)
      * 

+ 16 - 5
ruoyi-shipping/src/main/java/com/ruoyi/shipping/service/impl/TAddressServiceImpl.java

@@ -1,12 +1,16 @@
 package com.ruoyi.shipping.service.impl;
 
-import java.util.List;
 import com.ruoyi.common.utils.DateUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import com.ruoyi.shipping.mapper.TAddressMapper;
+import com.ruoyi.common.utils.SecurityUtils;
 import com.ruoyi.shipping.domain.TAddress;
+import com.ruoyi.shipping.mapper.TAddressMapper;
 import com.ruoyi.shipping.service.ITAddressService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
 
 /**
  * 地点基础信息(港口 码头 堆场 航线)Service业务层处理
@@ -44,6 +48,11 @@ public class TAddressServiceImpl implements ITAddressService
         return tAddressMapper.selectTAddressList(tAddress);
     }
 
+    @Override
+    public List<Map<String, Object>> selectTAddressListMap(TAddress tAddress) {
+        return tAddressMapper.selectTAddressListMap(tAddress);
+    }
+
     /**
      * 新增地点基础信息(港口 码头 堆场 航线)
      * 
@@ -53,7 +62,8 @@ public class TAddressServiceImpl implements ITAddressService
     @Override
     public int insertTAddress(TAddress tAddress)
     {
-        tAddress.setCreateTime(DateUtils.getNowDate());
+        tAddress.setCreateBy(SecurityUtils.getUsername());
+        tAddress.setCreateTime(new Date());
         return tAddressMapper.insertTAddress(tAddress);
     }
 
@@ -66,6 +76,7 @@ public class TAddressServiceImpl implements ITAddressService
     @Override
     public int updateTAddress(TAddress tAddress)
     {
+        tAddress.setUpdateBy(SecurityUtils.getUsername());
         tAddress.setUpdateTime(DateUtils.getNowDate());
         return tAddressMapper.updateTAddress(tAddress);
     }

+ 22 - 1
ruoyi-shipping/src/main/resources/mapper/shipping/TAddressMapper.xml

@@ -57,7 +57,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <include refid="selectTAddressVo"/>
         where f_id = #{fId}
     </select>
-        
+
+    <select id="selectTAddressListMap" resultType="java.util.Map">
+
+        <where>
+            <if test="fTypes != null  and fTypes != ''"> and f_types = #{fTypes}</if>
+            <if test="fNo != null  and fNo != ''"> and f_no = #{fNo}</if>
+            <if test="fName != null  and fName != ''"> and f_name like concat('%', #{fName}, '%')</if>
+            <if test="fEname != null  and fEname != ''"> and f_ename like concat('%', #{fEname}, '%')</if>
+            <if test="fLaneid != null "> and f_laneid = #{fLaneid}</if>
+            <if test="fPortid != null "> and f_portid = #{fPortid}</if>
+            <if test="fCountry != null  and fCountry != ''"> and f_country = #{fCountry}</if>
+            <if test="fProvince != null  and fProvince != ''"> and f_province = #{fProvince}</if>
+            <if test="fCity != null  and fCity != ''"> and f_city = #{fCity}</if>
+            <if test="fTel != null  and fTel != ''"> and f_tel = #{fTel}</if>
+            <if test="fEmail != null  and fEmail != ''"> and f_email = #{fEmail}</if>
+            <if test="fManagerid != null "> and f_managerid = #{fManagerid}</if>
+            <if test="fUncode != null  and fUncode != ''"> and f_uncode = #{fUncode}</if>
+            <if test="fPort != null  and fPort != ''"> and f_port = #{fPort}</if>
+            <if test="fStatus != null  and fStatus != ''"> and f_status = #{fStatus}</if>
+        </where>
+    </select>
+
     <insert id="insertTAddress" parameterType="TAddress">
         insert into t_address
         <trim prefix="(" suffix=")" suffixOverrides=",">