Przeglądaj źródła

油站信息表合并到集团信息表中

MS-QJVSRANLTYEO\Administrator 4 lat temu
rodzic
commit
ba52f4ebb0

+ 10 - 0
Yijia-SaaS/yijia-common/src/main/java/com/yijia/common/core/domain/entity/SysDept.java

@@ -81,6 +81,16 @@ public class SysDept extends BaseEntity
     /** 子部门 */
     private List<SysDept> children = new ArrayList<SysDept>();
 
+    private List<String> deptIdList;
+
+    public List<String> getDeptIdList() {
+        return deptIdList;
+    }
+
+    public void setDeptIdList(List<String> deptIdList) {
+        this.deptIdList = deptIdList;
+    }
+
     public String getDeptAddress() {
         return deptAddress;
     }

+ 18 - 48
Yijia-SaaS/yijia-station/src/main/java/com/yijia/station/controller/StationInfoController.java

@@ -3,8 +3,10 @@ package com.yijia.station.controller;
 import java.util.Arrays;
 import java.util.List;
 
+import com.yijia.common.core.domain.entity.SysDept;
 import com.yijia.common.core.domain.model.LoginUser;
 import com.yijia.common.utils.SecurityUtils;
+import com.yijia.system.service.ISysDeptService;
 import com.yijia.system.service.ISysUserService;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -36,73 +38,51 @@ import com.yijia.common.core.page.TableDataInfo;
 public class StationInfoController extends BaseController
 {
     @Autowired
-    private IStationInfoService stationInfoService;
-    @Autowired
     private ISysUserService sysUserService;
+    @Autowired
+    private ISysDeptService sysDeptService;
     /**
      * 查询油站信息列表
      */
     @PreAuthorize("@ss.hasPermi('station:info:list')")
     @GetMapping("/list")
-    public TableDataInfo list(StationInfo stationInfo)
+    public TableDataInfo list(SysDept sysDept)
     {
         LoginUser currentUser = SecurityUtils.getLoginUser();
         String selectDeptid= sysUserService.getUserRoleDeptId(currentUser);
         if(selectDeptid !=null && selectDeptid!=""){
             List<String> list = Arrays.asList(selectDeptid.split(","));
-            stationInfo.setStationIdList(list);
+            sysDept.setDeptIdList(list);
         }
         startPage();
-        List<StationInfo> list = stationInfoService.selectStationInfoList(stationInfo);
+        sysDept.setJiBie(Integer.valueOf("2"));
+        List<SysDept> list = sysDeptService.selectDeptList(sysDept);
         return getDataTable(list);
     }
 
     @PreAuthorize("@ss.hasPermi('station:info:selectStationInfo')")
     @GetMapping("/selectStationInfo")
-    public TableDataInfo selectStationInfo(StationInfo stationInfo)
+    public TableDataInfo selectStationInfo(SysDept sysDept)
     {
         LoginUser currentUser = SecurityUtils.getLoginUser();
         String selectDeptid= sysUserService.getUserRoleDeptId(currentUser);
         if(selectDeptid !=null && selectDeptid!=""){
             List<String> list = Arrays.asList(selectDeptid.split(","));
-            stationInfo.setStationIdList(list);
+            sysDept.setDeptIdList(list);
         }
-        List<StationInfo> list = stationInfoService.selectStationInfoList(stationInfo);
-        return getDataTable(list);
-    }
-
-    /**
-     * 导出油站信息列表
-     */
-    @PreAuthorize("@ss.hasPermi('station:info:export')")
-    @Log(title = "油站信息", businessType = BusinessType.EXPORT)
-    @GetMapping("/export")
-    public AjaxResult export(StationInfo stationInfo)
-    {
-        List<StationInfo> list = stationInfoService.selectStationInfoList(stationInfo);
-        ExcelUtil<StationInfo> util = new ExcelUtil<StationInfo>(StationInfo.class);
-        return util.exportExcel(list, "info");
+        sysDept.setJiBie(Integer.valueOf("2"));
+        List<SysDept> list = sysDeptService.selectDeptList(sysDept);
+        return getTable(list);
     }
 
     /**
      * 获取油站信息详细信息
      */
     @PreAuthorize("@ss.hasPermi('station:info:query')")
-    @GetMapping(value = "/{stationId}")
-    public AjaxResult getInfo(@PathVariable("stationId") Long stationId)
+    @GetMapping(value = "/{deptId}")
+    public AjaxResult getInfo(@PathVariable("deptId") Long deptId)
     {
-        return AjaxResult.success(stationInfoService.selectStationInfoById(stationId));
-    }
-
-    /**
-     * 新增油站信息
-     */
-    @PreAuthorize("@ss.hasPermi('station:info:add')")
-    @Log(title = "油站信息", businessType = BusinessType.INSERT)
-    @PostMapping
-    public AjaxResult add(@RequestBody StationInfo stationInfo)
-    {
-        return toAjax(stationInfoService.insertStationInfo(stationInfo));
+        return AjaxResult.success(sysDeptService.selectDeptById(deptId));
     }
 
     /**
@@ -111,19 +91,9 @@ public class StationInfoController extends BaseController
     @PreAuthorize("@ss.hasPermi('station:info:edit')")
     @Log(title = "油站信息", businessType = BusinessType.UPDATE)
     @PutMapping
-    public AjaxResult edit(@RequestBody StationInfo stationInfo)
+    public AjaxResult edit(@RequestBody SysDept sysDept)
     {
-        return toAjax(stationInfoService.updateStationInfo(stationInfo));
+        return toAjax(sysDeptService.updateDept(sysDept));
     }
 
-    /**
-     * 删除油站信息
-     */
-    @PreAuthorize("@ss.hasPermi('station:info:remove')")
-    @Log(title = "油站信息", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{stationIds}")
-    public AjaxResult remove(@PathVariable Long[] stationIds)
-    {
-        return toAjax(stationInfoService.deleteStationInfoByIds(stationIds));
-    }
 }

+ 3 - 0
Yijia-SaaS/yijia-system/src/main/resources/mapper/system/SysDeptMapper.xml

@@ -39,6 +39,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 	<select id="selectDeptList" parameterType="SysDept" resultMap="SysDeptResult">
         <include refid="selectDeptVo"/>
         where d.del_flag = '0'
+		<if test="jiBie != null">
+			AND ji_bie = #{jiBie}
+		</if>
         <if test="parentId != null and parentId != 0">
 			AND parent_id = #{parentId}
 		</if>

+ 3 - 0
Yijia-SaaS/yijia-system/target/classes/mapper/system/SysDeptMapper.xml

@@ -39,6 +39,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 	<select id="selectDeptList" parameterType="SysDept" resultMap="SysDeptResult">
         <include refid="selectDeptVo"/>
         where d.del_flag = '0'
+		<if test="jiBie != null">
+			AND ji_bie = #{jiBie}
+		</if>
         <if test="parentId != null and parentId != 0">
 			AND parent_id = #{parentId}
 		</if>