Parcourir la source

Merge branch 'master' of http://49.4.53.36:3000/hotel/hotel-saas-backend

shenzhongzheng il y a 2 ans
Parent
commit
d05c2d9306
22 fichiers modifiés avec 1860 ajouts et 1 suppressions
  1. 241 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/controller/BusDictController.java
  2. 258 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/controller/BusDictItemController.java
  3. 232 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/controller/BusSalesPersonController.java
  4. 1 1
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/controller/BusWaiterController.java
  5. 88 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/entity/BusDict.java
  6. 92 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/entity/BusDictItem.java
  7. 100 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/entity/BusSalesPerson.java
  8. 37 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/BusDictItemMapper.java
  9. 17 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/BusDictMapper.java
  10. 17 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/BusSalesPersonMapper.java
  11. 4 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/xml/BusDictItemMapper.xml
  12. 5 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/xml/BusDictMapper.xml
  13. 5 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/xml/BusSalesPersonMapper.xml
  14. 284 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/model/BusDictTreeModel.java
  15. 100 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/model/DictIdModel.java
  16. 26 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/IBusDictItemService.java
  17. 28 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/IBusDictService.java
  18. 15 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/IBusSalesPersonService.java
  19. 36 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/impl/BusDictItemServiceImpl.java
  20. 68 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/impl/BusDictServiceImpl.java
  21. 19 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/impl/BusSalesPersonServiceImpl.java
  22. 187 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/util/FindsBusDictsChildrenUtil.java

+ 241 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/controller/BusDictController.java

@@ -0,0 +1,241 @@
+package org.jeecg.modules.business.controller;
+
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.constant.CommonConstant;
+import org.jeecg.common.exception.JeecgBootException;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.system.vo.LoginUser;
+import org.jeecg.common.util.TokenUtils;
+import org.jeecg.common.util.oConvertUtils;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import lombok.extern.slf4j.Slf4j;
+
+import org.jeecg.modules.business.entity.BusDict;
+import org.jeecg.modules.business.entity.BusWaiter;
+import org.jeecg.modules.business.model.BusDictTreeModel;
+import org.jeecg.modules.business.service.IBusDictService;
+import org.jeecg.modules.system.entity.SysUser;
+import org.jeecg.modules.system.model.SysDepartTreeModel;
+import org.jeecg.modules.system.model.SysUserSysDepartModel;
+import org.jeecgframework.poi.excel.ExcelImportUtil;
+import org.jeecgframework.poi.excel.def.NormalExcelConstants;
+import org.jeecgframework.poi.excel.entity.ExportParams;
+import org.jeecgframework.poi.excel.entity.ImportParams;
+import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
+import org.jeecg.common.system.base.controller.JeecgController;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import org.springframework.web.servlet.ModelAndView;
+import com.alibaba.fastjson.JSON;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.jeecg.common.aspect.annotation.AutoLog;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+
+ /**
+ * @Description: 业务字典表
+ * @Author: jeecg-boot
+ * @Date:   2023-03-06
+ * @Version: V1.0
+ */
+@Api(tags="业务字典表")
+@RestController
+@RequestMapping("/business/busDict")
+@Slf4j
+public class BusDictController extends JeecgController<BusDict, IBusDictService> {
+	@Autowired
+	private IBusDictService busDictService;
+
+	/**
+	 * 分页列表查询
+	 *
+	 * @param busDict
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	//@AutoLog(value = "业务字典表-分页列表查询")
+	@ApiOperation(value="业务字典表-分页列表查询", notes="业务字典表-分页列表查询")
+	@GetMapping(value = "/list")
+	public Result<IPage<BusDict>> queryPageList(BusDict busDict,
+								   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+								   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+								   HttpServletRequest req) {
+		QueryWrapper<BusDict> queryWrapper = QueryGenerator.initQueryWrapper(busDict, req.getParameterMap());
+		Page<BusDict> page = new Page<BusDict>(pageNo, pageSize);
+		IPage<BusDict> pageList = busDictService.page(page, queryWrapper);
+		return Result.OK(pageList);
+	}
+
+	/**
+	 *   添加
+	 *
+	 * @param busDict
+	 * @return
+	 */
+	@AutoLog(value = "业务字典表-添加")
+	@ApiOperation(value="业务字典表-添加", notes="业务字典表-添加")
+	//@RequiresPermissions("business:bus_dict_info:add")
+	@PostMapping(value = "/add")
+	public Result<String> add(@RequestBody BusDict busDict) {
+		busDict.setDelFlag(CommonConstant.DEL_FLAG_0);
+		if(busDict.getTenantId() == null || busDict.getTenantId().equals("")){
+			LoginUser user = TokenUtils.getAuthUser();
+			if(user.getRelTenantIds() != null && !user.getRelTenantIds().equals("")){
+				busDict.setTenantId(user.getRelTenantIds());
+			} else {
+				throw new JeecgBootException("当前登录人租户信息错误");
+			}
+		}
+		busDictService.save(busDict);
+		return Result.OK("添加成功!");
+	}
+
+	/**
+	 *  编辑
+	 *
+	 * @param busDict
+	 * @return
+	 */
+	@AutoLog(value = "业务字典表-编辑")
+	@ApiOperation(value="业务字典表-编辑", notes="业务字典表-编辑")
+	//@RequiresPermissions("business:bus_dict_info:edit")
+	@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
+	public Result<String> edit(@RequestBody BusDict busDict) {
+//		busDictService.updateById(busDict);
+		if(busDict.getTenantId() == null || busDict.getTenantId().equals("")){
+			LoginUser user = TokenUtils.getAuthUser();
+			if(user.getRelTenantIds() != null && !user.getRelTenantIds().equals("")){
+				busDict.setTenantId(user.getRelTenantIds());
+			} else {
+				throw new JeecgBootException("当前登录人租户信息错误");
+			}
+		}
+		BusDict editModel = busDictService.getById(busDict.getId());
+		editModel.setDictName(busDict.getDictName());
+		editModel.setDictCode(busDict.getDictCode());
+		editModel.setDescription(busDict.getDescription());
+		busDictService.updateById(editModel);
+		return Result.OK("编辑成功!");
+	}
+
+	/**
+	 *   通过id删除
+	 *
+	 * @param id
+	 * @return
+	 */
+	@AutoLog(value = "业务字典表-通过id删除")
+	@ApiOperation(value="业务字典表-通过id删除", notes="业务字典表-通过id删除")
+	//@RequiresPermissions("business:bus_dict_info:delete")
+	@DeleteMapping(value = "/delete")
+	public Result<String> delete(@RequestParam(name="id",required=true) String id) {
+		busDictService.removeById(id);
+		return Result.OK("删除成功!");
+	}
+
+	/**
+	 *  批量删除
+	 *
+	 * @param ids
+	 * @return
+	 */
+	@AutoLog(value = "业务字典表-批量删除")
+	@ApiOperation(value="业务字典表-批量删除", notes="业务字典表-批量删除")
+	//@RequiresPermissions("business:bus_dict_info:deleteBatch")
+	@DeleteMapping(value = "/deleteBatch")
+	public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
+		this.busDictService.removeByIds(Arrays.asList(ids.split(",")));
+		return Result.OK("批量删除成功!");
+	}
+
+	/**
+	 * 通过id查询
+	 *
+	 * @param id
+	 * @return
+	 */
+	//@AutoLog(value = "业务字典表-通过id查询")
+	@ApiOperation(value="业务字典表-通过id查询", notes="业务字典表-通过id查询")
+	@GetMapping(value = "/queryById")
+	public Result<BusDict> queryById(@RequestParam(name="id",required=true) String id) {
+		BusDict busDict = busDictService.getById(id);
+		if(busDict==null) {
+			return Result.error("未找到对应数据");
+		}
+		return Result.OK(busDict);
+	}
+
+    /**
+    * 导出excel
+    *
+    * @param request
+    * @param busDict
+    */
+    //@RequiresPermissions("business:bus_dict_info:exportXls")
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, BusDict busDict) {
+        return super.exportXls(request, busDict, BusDict.class, "业务字典表");
+    }
+
+    /**
+      * 通过excel导入数据
+    *
+    * @param request
+    * @param response
+    * @return
+    */
+    //@RequiresPermissions("business:bus_dict_info:importExcel")
+    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+        return super.importExcel(request, response, BusDict.class);
+    }
+
+	 /**
+	  * 查询数据 查出所有字典,并以树结构数据格式响应给前端
+	  *
+	  * @return
+	  */
+	 @RequestMapping(value = "/queryTreeList", method = RequestMethod.GET)
+	 public Result<List<BusDictTreeModel>> queryTreeList(@RequestParam(name = "ids", required = false) String ids) {
+		 Result<List<BusDictTreeModel>> result = new Result<>();
+		 try {
+			 // 从内存中读取
+//			List<SysDepartTreeModel> list =FindsDepartsChildrenUtil.getSysDepartTreeList();
+//			if (CollectionUtils.isEmpty(list)) {
+//				list = sysDepartService.queryTreeList();
+//			}
+			 if(oConvertUtils.isNotEmpty(ids)){
+				 List<BusDictTreeModel> departList = busDictService.queryTreeList(ids);
+				 result.setResult(departList);
+			 }else{
+				 List<BusDictTreeModel> list = busDictService.queryTreeList();
+				 result.setResult(list);
+			 }
+			 result.setSuccess(true);
+		 } catch (Exception e) {
+			 log.error(e.getMessage(),e);
+		 }
+		 return result;
+	 }
+
+}

+ 258 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/controller/BusDictItemController.java

@@ -0,0 +1,258 @@
+package org.jeecg.modules.business.controller;
+
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.constant.CommonConstant;
+import org.jeecg.common.exception.JeecgBootException;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.system.vo.LoginUser;
+import org.jeecg.common.util.TokenUtils;
+import org.jeecg.common.util.oConvertUtils;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import lombok.extern.slf4j.Slf4j;
+
+import org.jeecg.modules.business.entity.BusDict;
+import org.jeecg.modules.business.entity.BusDictItem;
+import org.jeecg.modules.business.service.IBusDictItemService;
+import org.jeecg.modules.system.entity.SysUser;
+import org.jeecg.modules.system.model.SysUserSysDepartModel;
+import org.jeecgframework.poi.excel.ExcelImportUtil;
+import org.jeecgframework.poi.excel.def.NormalExcelConstants;
+import org.jeecgframework.poi.excel.entity.ExportParams;
+import org.jeecgframework.poi.excel.entity.ImportParams;
+import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
+import org.jeecg.common.system.base.controller.JeecgController;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import org.springframework.web.servlet.ModelAndView;
+import com.alibaba.fastjson.JSON;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.jeecg.common.aspect.annotation.AutoLog;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+
+ /**
+ * @Description: 业务字典配置表
+ * @Author: jeecg-boot
+ * @Date:   2023-03-06
+ * @Version: V1.0
+ */
+@Api(tags="业务字典配置表")
+@RestController
+@RequestMapping("/business/busDictItem")
+@Slf4j
+public class BusDictItemController extends JeecgController<BusDictItem, IBusDictItemService> {
+	@Autowired
+	private IBusDictItemService busDictItemService;
+
+	/**
+	 * 分页列表查询
+	 *
+	 * @param busDictItem
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	//@AutoLog(value = "业务字典配置表-分页列表查询")
+	@ApiOperation(value="业务字典配置表-分页列表查询", notes="业务字典配置表-分页列表查询")
+	@GetMapping(value = "/list")
+	public Result<IPage<BusDictItem>> queryPageList(BusDictItem busDictItem,
+								   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+								   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+								   HttpServletRequest req) {
+		QueryWrapper<BusDictItem> queryWrapper = QueryGenerator.initQueryWrapper(busDictItem, req.getParameterMap());
+		Page<BusDictItem> page = new Page<BusDictItem>(pageNo, pageSize);
+		IPage<BusDictItem> pageList = busDictItemService.page(page, queryWrapper);
+		return Result.OK(pageList);
+	}
+
+	/**
+	 *   添加
+	 *
+	 * @param busDictItem
+	 * @return
+	 */
+	@AutoLog(value = "业务字典配置表-添加")
+	@ApiOperation(value="业务字典配置表-添加", notes="业务字典配置表-添加")
+	//@RequiresPermissions("business:bus_dict_item_info:add")
+	@PostMapping(value = "/add")
+	public Result<String> add(@RequestBody BusDictItem busDictItem) {
+		busDictItem.setDelFlag(CommonConstant.DEL_FLAG_0);
+		if(busDictItem.getTenantId() == null || busDictItem.getTenantId().equals("")){
+			LoginUser user = TokenUtils.getAuthUser();
+			if(user.getRelTenantIds() != null && !user.getRelTenantIds().equals("")){
+				busDictItem.setTenantId(user.getRelTenantIds());
+			} else {
+				throw new JeecgBootException("当前登录人租户信息错误");
+			}
+		}
+		busDictItemService.save(busDictItem);
+		return Result.OK("添加成功!");
+	}
+
+	/**
+	 *  编辑
+	 *
+	 * @param busDictItem
+	 * @return
+	 */
+	@AutoLog(value = "业务字典配置表-编辑")
+	@ApiOperation(value="业务字典配置表-编辑", notes="业务字典配置表-编辑")
+	//@RequiresPermissions("business:bus_dict_item_info:edit")
+	@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
+	public Result<String> edit(@RequestBody BusDictItem busDictItem) {
+//		busDictItemService.updateById(busDictItem);
+		if(busDictItem.getTenantId() == null || busDictItem.getTenantId().equals("")){
+			LoginUser user = TokenUtils.getAuthUser();
+			if(user.getRelTenantIds() != null && !user.getRelTenantIds().equals("")){
+				busDictItem.setTenantId(user.getRelTenantIds());
+			} else {
+				throw new JeecgBootException("当前登录人租户信息错误");
+			}
+		}
+		BusDictItem editModel = busDictItemService.getById(busDictItem.getId());
+		editModel.setDictId(busDictItem.getDictId());
+		editModel.setItemText(busDictItem.getItemText());
+		editModel.setItemValue(busDictItem.getItemValue());
+		editModel.setDescription(busDictItem.getDescription());
+		editModel.setSortOrder(busDictItem.getSortOrder());
+		editModel.setStatus(busDictItem.getStatus());
+		busDictItemService.updateById(editModel);
+		return Result.OK("编辑成功!");
+	}
+
+	/**
+	 *   通过id删除
+	 *
+	 * @param id
+	 * @return
+	 */
+	@AutoLog(value = "业务字典配置表-通过id删除")
+	@ApiOperation(value="业务字典配置表-通过id删除", notes="业务字典配置表-通过id删除")
+	//@RequiresPermissions("business:bus_dict_item_info:delete")
+	@DeleteMapping(value = "/delete")
+	public Result<String> delete(@RequestParam(name="id",required=true) String id) {
+		busDictItemService.removeById(id);
+		return Result.OK("删除成功!");
+	}
+
+	/**
+	 *  批量删除
+	 *
+	 * @param ids
+	 * @return
+	 */
+	@AutoLog(value = "业务字典配置表-批量删除")
+	@ApiOperation(value="业务字典配置表-批量删除", notes="业务字典配置表-批量删除")
+	//@RequiresPermissions("business:bus_dict_item_info:deleteBatch")
+	@DeleteMapping(value = "/deleteBatch")
+	public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
+		this.busDictItemService.removeByIds(Arrays.asList(ids.split(",")));
+		return Result.OK("批量删除成功!");
+	}
+
+	/**
+	 * 通过id查询
+	 *
+	 * @param id
+	 * @return
+	 */
+	//@AutoLog(value = "业务字典配置表-通过id查询")
+	@ApiOperation(value="业务字典配置表-通过id查询", notes="业务字典配置表-通过id查询")
+	@GetMapping(value = "/queryById")
+	public Result<BusDictItem> queryById(@RequestParam(name="id",required=true) String id) {
+		BusDictItem busDictItem = busDictItemService.getById(id);
+		if(busDictItem==null) {
+			return Result.error("未找到对应数据");
+		}
+		return Result.OK(busDictItem);
+	}
+
+    /**
+    * 导出excel
+    *
+    * @param request
+    * @param busDictItem
+    */
+    //@RequiresPermissions("business:bus_dict_item_info:exportXls")
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, BusDictItem busDictItem) {
+        return super.exportXls(request, busDictItem, BusDictItem.class, "业务字典配置表");
+    }
+
+    /**
+      * 通过excel导入数据
+    *
+    * @param request
+    * @param response
+    * @return
+    */
+    //@RequiresPermissions("business:bus_dict_item_info:importExcel")
+    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+        return super.importExcel(request, response, BusDictItem.class);
+    }
+
+	 /**
+	  * 根据 dictId 查询字典值
+	  */
+	 @GetMapping("/queryByParentIdList")
+	 public Result<?> queryByOrgCodeForAddressList(
+			 @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+			 @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+			 @RequestParam(name = "dictId",required = false) String dictId,
+			 BusDictItem busDictItem
+	 ) {
+		 IPage page = new Page(pageNo, pageSize);
+		 IPage<BusDictItem> pageList = busDictItemService.queryItemByParentId(dictId, busDictItem, page);
+		 List<BusDictItem> list = pageList.getRecords();
+
+		 // 记录所有出现过的 user, key = userId
+		 Map<String, JSONObject> hasUser = new HashMap<>(list.size());
+
+		 JSONArray resultJson = new JSONArray(list.size());
+
+//		 for (BusDictItem item : list) {
+//			 String userId = item.getId();
+//			 // userId
+//			 JSONObject getModel = hasUser.get(userId);
+//			 // 之前已存在过该用户,直接合并数据
+//			 if (getModel != null) {
+//				 String departName = getModel.get("departName").toString();
+//				 getModel.put("departName", (departName + " | " + item.getDepartName()));
+//			 } else {
+//				 // 将用户对象转换为json格式,并将部门信息合并到 json 中
+//				 JSONObject json = JSON.parseObject(JSON.toJSONString(item));
+//				 json.remove("id");
+//				 json.put("userId", userId);
+//				 json.put("departId", item.getDepartId());
+//				 json.put("departName", item.getDepartName());
+////                json.put("avatar", item.getSysUser().getAvatar());
+//				 resultJson.add(json);
+//				 hasUser.put(userId, json);
+//			 }
+//		 }
+
+		 IPage<JSONObject> result = new Page<>(pageNo, pageSize, pageList.getTotal());
+		 result.setRecords(resultJson.toJavaList(JSONObject.class));
+		 return Result.ok(result);
+	 }
+}

+ 232 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/controller/BusSalesPersonController.java

@@ -0,0 +1,232 @@
+package org.jeecg.modules.business.controller;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.constant.CommonConstant;
+import org.jeecg.common.exception.JeecgBootException;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.system.vo.LoginUser;
+import org.jeecg.common.util.TokenUtils;
+import org.jeecg.common.util.oConvertUtils;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import lombok.extern.slf4j.Slf4j;
+
+import org.jeecg.modules.business.entity.BusSalesPerson;
+import org.jeecg.modules.business.entity.BusWaiter;
+import org.jeecg.modules.business.service.IBusSalesPersonService;
+import org.jeecgframework.poi.excel.ExcelImportUtil;
+import org.jeecgframework.poi.excel.def.NormalExcelConstants;
+import org.jeecgframework.poi.excel.entity.ExportParams;
+import org.jeecgframework.poi.excel.entity.ImportParams;
+import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
+import org.jeecg.common.system.base.controller.JeecgController;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import org.springframework.web.servlet.ModelAndView;
+import com.alibaba.fastjson.JSON;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.jeecg.common.aspect.annotation.AutoLog;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+
+ /**
+ * @Description: 营销人员管理
+ * @Author: jeecg-boot
+ * @Date:   2023-03-06
+ * @Version: V1.0
+ */
+@Api(tags="营销人员管理")
+@RestController
+@RequestMapping("/business/busSalesPerson")
+@Slf4j
+public class BusSalesPersonController extends JeecgController<BusSalesPerson, IBusSalesPersonService> {
+	@Autowired
+	private IBusSalesPersonService busSalesPersonService;
+
+	/**
+	 * 分页列表查询
+	 *
+	 * @param busSalesPerson
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	//@AutoLog(value = "营销人员管理-分页列表查询")
+	@ApiOperation(value="营销人员管理-分页列表查询", notes="营销人员管理-分页列表查询")
+	@GetMapping(value = "/list")
+	public Result<IPage<BusSalesPerson>> queryPageList(BusSalesPerson busSalesPerson,
+								   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+								   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+								   HttpServletRequest req) {
+		QueryWrapper<BusSalesPerson> queryWrapper = QueryGenerator.initQueryWrapper(busSalesPerson, req.getParameterMap());
+		LoginUser user = TokenUtils.getAuthUser();
+		if(user.getRelTenantIds() != null && !user.getRelTenantIds().equals("")){
+			queryWrapper.eq("tenant_id",user.getRelTenantIds());
+		}
+		String keyWord = req.getParameter("keyWord");
+		if(oConvertUtils.isNotEmpty(keyWord)){
+			queryWrapper.or().like("name",keyWord);
+			queryWrapper.or().like("work_no",keyWord);
+		}
+		String hotelIds = req.getParameter("hotelId");
+//		String hotelId = req.getParameter("hotelId");
+//		if(oConvertUtils.isNotEmpty(hotelId)){
+//			queryWrapper.eq("hotel_id",hotelId);
+//		}
+		if (oConvertUtils.isNotEmpty(hotelIds)) {
+			List<String> selectionList = Arrays.asList(hotelIds.split(","));
+			queryWrapper.in("hotel_id",selectionList);
+		}else{
+//			if (oConvertUtils.isNotEmpty(hotelId)) {
+//				queryWrapper.eq("hotel_id",hotelId);
+//			}
+		}
+		Page<BusSalesPerson> page = new Page<BusSalesPerson>(pageNo, pageSize);
+		IPage<BusSalesPerson> pageList = busSalesPersonService.page(page, queryWrapper);
+		return Result.OK(pageList);
+	}
+
+	/**
+	 *   添加
+	 *
+	 * @param busSalesPerson
+	 * @return
+	 */
+	@AutoLog(value = "营销人员管理-添加")
+	@ApiOperation(value="营销人员管理-添加", notes="营销人员管理-添加")
+	//@RequiresPermissions("business:bus_sales_person_info:add")
+	@PostMapping(value = "/add")
+	public Result<String> add(@RequestBody BusSalesPerson busSalesPerson) {
+		busSalesPerson.setDelFlag(CommonConstant.DEL_FLAG_0);
+		if(busSalesPerson.getTenantId() == null || busSalesPerson.getTenantId().equals("")){
+			LoginUser user = TokenUtils.getAuthUser();
+			if(user.getRelTenantIds() != null && !user.getRelTenantIds().equals("")){
+				busSalesPerson.setTenantId(user.getRelTenantIds());
+			} else {
+				throw new JeecgBootException("当前登录人租户信息错误");
+			}
+		}
+		busSalesPersonService.save(busSalesPerson);
+		return Result.OK("添加成功!");
+	}
+
+	/**
+	 *  编辑
+	 *
+	 * @param busSalesPerson
+	 * @return
+	 */
+	@AutoLog(value = "营销人员管理-编辑")
+	@ApiOperation(value="营销人员管理-编辑", notes="营销人员管理-编辑")
+	//@RequiresPermissions("business:bus_sales_person_info:edit")
+	@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
+	public Result<String> edit(@RequestBody BusSalesPerson busSalesPerson) {
+		if(busSalesPerson.getTenantId() == null || busSalesPerson.getTenantId().equals("")){
+			LoginUser user = TokenUtils.getAuthUser();
+			if(user.getRelTenantIds() != null && !user.getRelTenantIds().equals("")){
+				busSalesPerson.setTenantId(user.getRelTenantIds());
+			} else {
+				throw new JeecgBootException("当前登录人租户信息错误");
+			}
+		}
+		BusSalesPerson editModel = busSalesPersonService.getById(busSalesPerson.getId());
+		editModel.setWorkNo(busSalesPerson.getWorkNo());
+		editModel.setName(busSalesPerson.getName());
+		//职务--待处理
+		editModel.setOperatorId(busSalesPerson.getOperatorId());
+		editModel.setMobile(busSalesPerson.getMobile());
+		editModel.setPhone(busSalesPerson.getPhone());
+		editModel.setAddress(busSalesPerson.getAddress());
+		editModel.setRemarks(busSalesPerson.getRemarks());
+		editModel.setStatus(busSalesPerson.getStatus());
+		busSalesPersonService.updateById(editModel);
+		return Result.OK("编辑成功!");
+	}
+
+	/**
+	 *   通过id删除
+	 *
+	 * @param id
+	 * @return
+	 */
+	@AutoLog(value = "营销人员管理-通过id删除")
+	@ApiOperation(value="营销人员管理-通过id删除", notes="营销人员管理-通过id删除")
+	//@RequiresPermissions("business:bus_sales_person_info:delete")
+	@DeleteMapping(value = "/delete")
+	public Result<String> delete(@RequestParam(name="id",required=true) String id) {
+		busSalesPersonService.removeById(id);
+		return Result.OK("删除成功!");
+	}
+
+	/**
+	 *  批量删除
+	 *
+	 * @param ids
+	 * @return
+	 */
+	@AutoLog(value = "营销人员管理-批量删除")
+	@ApiOperation(value="营销人员管理-批量删除", notes="营销人员管理-批量删除")
+	//@RequiresPermissions("business:bus_sales_person_info:deleteBatch")
+	@DeleteMapping(value = "/deleteBatch")
+	public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
+		this.busSalesPersonService.removeByIds(Arrays.asList(ids.split(",")));
+		return Result.OK("批量删除成功!");
+	}
+
+	/**
+	 * 通过id查询
+	 *
+	 * @param id
+	 * @return
+	 */
+	//@AutoLog(value = "营销人员管理-通过id查询")
+	@ApiOperation(value="营销人员管理-通过id查询", notes="营销人员管理-通过id查询")
+	@GetMapping(value = "/queryById")
+	public Result<BusSalesPerson> queryById(@RequestParam(name="id",required=true) String id) {
+		BusSalesPerson busSalesPerson = busSalesPersonService.getById(id);
+		if(busSalesPerson==null) {
+			return Result.error("未找到对应数据");
+		}
+		return Result.OK(busSalesPerson);
+	}
+
+    /**
+    * 导出excel
+    *
+    * @param request
+    * @param busSalesPerson
+    */
+    //@RequiresPermissions("business:bus_sales_person_info:exportXls")
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, BusSalesPerson busSalesPerson) {
+        return super.exportXls(request, busSalesPerson, BusSalesPerson.class, "营销人员管理");
+    }
+
+    /**
+      * 通过excel导入数据
+    *
+    * @param request
+    * @param response
+    * @return
+    */
+    //@RequiresPermissions("business:bus_sales_person_info:importExcel")
+    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+        return super.importExcel(request, response, BusSalesPerson.class);
+    }
+
+}

+ 1 - 1
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/controller/BusWaiterController.java

@@ -150,7 +150,7 @@ public class BusWaiterController extends JeecgController<BusWaiter, IBusWaiterSe
 		editModel.setSex(busWaiter.getSex());
 		editModel.setStatus(busWaiter.getStatus());
 		editModel.setRemarks(busWaiter.getRemarks());
-		busWaiterService.updateById(busWaiter);
+		busWaiterService.updateById(editModel);
 		return Result.OK("编辑成功!");
 	}
 

+ 88 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/entity/BusDict.java

@@ -0,0 +1,88 @@
+package org.jeecg.modules.business.entity;
+
+import java.io.Serializable;
+import java.io.UnsupportedEncodingException;
+import java.util.Date;
+import java.math.BigDecimal;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import lombok.Data;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springframework.format.annotation.DateTimeFormat;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.jeecg.common.aspect.annotation.Dict;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * @Description: 业务字典表
+ * @Author: jeecg-boot
+ * @Date:   2023-03-06
+ * @Version: V1.0
+ */
+@Data
+@TableName("bus_dict_info")
+@Accessors(chain = true)
+@EqualsAndHashCode(callSuper = false)
+@ApiModel(value="bus_dict_info对象", description="业务字典表")
+public class BusDict implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+	/**主键*/
+	@TableId(type = IdType.ASSIGN_ID)
+    @ApiModelProperty(value = "主键")
+    private String id;
+    /**上级*/
+    @Excel(name = "上级", width = 15)
+    @ApiModelProperty(value = "上级")
+    private String parentId;
+	/**关联租户*/
+	@Excel(name = "关联租户", width = 15)
+    @ApiModelProperty(value = "关联租户")
+    private String tenantId;
+	/**关联酒店*/
+	@Excel(name = "关联酒店", width = 15)
+    @ApiModelProperty(value = "关联酒店")
+    private String hotelId;
+	/**字典名称*/
+	@Excel(name = "字典名称", width = 15)
+    @ApiModelProperty(value = "字典名称")
+    private String dictName;
+	/**字典编码*/
+	@Excel(name = "字典编码", width = 15)
+    @ApiModelProperty(value = "字典编码")
+    private String dictCode;
+	/**描述*/
+	@Excel(name = "描述", width = 15)
+    @ApiModelProperty(value = "描述")
+    private String description;
+	/**删除状态*/
+	@Excel(name = "删除状态", width = 15)
+    @ApiModelProperty(value = "删除状态")
+    @TableLogic
+    private Integer delFlag;
+	/**创建人*/
+    @ApiModelProperty(value = "创建人")
+    private String createBy;
+	/**创建时间*/
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern="yyyy-MM-dd")
+    @ApiModelProperty(value = "创建时间")
+    private Date createTime;
+	/**更新人*/
+    @ApiModelProperty(value = "更新人")
+    private String updateBy;
+	/**更新时间*/
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern="yyyy-MM-dd")
+    @ApiModelProperty(value = "更新时间")
+    private Date updateTime;
+	/**字典类型0为string,1为number*/
+	@Excel(name = "字典类型0为string,1为number", width = 15)
+    @ApiModelProperty(value = "字典类型0为string,1为number")
+    private Integer type;
+}

+ 92 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/entity/BusDictItem.java

@@ -0,0 +1,92 @@
+package org.jeecg.modules.business.entity;
+
+import java.io.Serializable;
+import java.io.UnsupportedEncodingException;
+import java.util.Date;
+import java.math.BigDecimal;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import lombok.Data;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springframework.format.annotation.DateTimeFormat;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.jeecg.common.aspect.annotation.Dict;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * @Description: 业务字典配置表
+ * @Author: jeecg-boot
+ * @Date:   2023-03-06
+ * @Version: V1.0
+ */
+@Data
+@TableName("bus_dict_item_info")
+@Accessors(chain = true)
+@EqualsAndHashCode(callSuper = false)
+@ApiModel(value="bus_dict_item_info对象", description="业务字典配置表")
+public class BusDictItem implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+	/**主键*/
+	@TableId(type = IdType.ASSIGN_ID)
+    @ApiModelProperty(value = "主键")
+    private String id;
+	/**关联租户*/
+	@Excel(name = "关联租户", width = 15)
+    @ApiModelProperty(value = "关联租户")
+    private String tenantId;
+	/**关联酒店*/
+	@Excel(name = "关联酒店", width = 15)
+    @ApiModelProperty(value = "关联酒店")
+    private String hotelId;
+	/**字典id*/
+	@Excel(name = "字典id", width = 15)
+    @ApiModelProperty(value = "字典id")
+    private String dictId;
+	/**字典项文本*/
+	@Excel(name = "字典项文本", width = 15)
+    @ApiModelProperty(value = "字典项文本")
+    private String itemText;
+	/**字典项值*/
+	@Excel(name = "字典项值", width = 15)
+    @ApiModelProperty(value = "字典项值")
+    private String itemValue;
+	/**描述*/
+	@Excel(name = "描述", width = 15)
+    @ApiModelProperty(value = "描述")
+    private String description;
+	/**排序*/
+	@Excel(name = "排序", width = 15)
+    @ApiModelProperty(value = "排序")
+    private Integer sortOrder;
+	/**状态(1启用 0不启用)*/
+	@Excel(name = "状态(1启用 0不启用)", width = 15)
+    @ApiModelProperty(value = "状态(1启用 0不启用)")
+    private Integer status;
+    /**删除状态*/
+    @Excel(name = "删除状态", width = 15)
+    @ApiModelProperty(value = "删除状态")
+    @TableLogic
+    private Integer delFlag;
+	/**createBy*/
+    @ApiModelProperty(value = "createBy")
+    private String createBy;
+	/**createTime*/
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern="yyyy-MM-dd")
+    @ApiModelProperty(value = "createTime")
+    private Date createTime;
+	/**updateBy*/
+    @ApiModelProperty(value = "updateBy")
+    private String updateBy;
+	/**updateTime*/
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern="yyyy-MM-dd")
+    @ApiModelProperty(value = "updateTime")
+    private Date updateTime;
+}

+ 100 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/entity/BusSalesPerson.java

@@ -0,0 +1,100 @@
+package org.jeecg.modules.business.entity;
+
+import java.io.Serializable;
+import java.io.UnsupportedEncodingException;
+import java.util.Date;
+import java.math.BigDecimal;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import lombok.Data;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springframework.format.annotation.DateTimeFormat;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.jeecg.common.aspect.annotation.Dict;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * @Description: 营销人员管理
+ * @Author: jeecg-boot
+ * @Date:   2023-03-06
+ * @Version: V1.0
+ */
+@Data
+@TableName("bus_sales_person_info")
+@Accessors(chain = true)
+@EqualsAndHashCode(callSuper = false)
+@ApiModel(value="bus_sales_person_info对象", description="营销人员管理")
+public class BusSalesPerson implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+	/**主键*/
+	@TableId(type = IdType.ASSIGN_ID)
+    @ApiModelProperty(value = "主键")
+    private String id;
+	/**关联租户*/
+	@Excel(name = "关联租户", width = 15)
+    @ApiModelProperty(value = "关联租户")
+    private String tenantId;
+	/**关联酒店*/
+	@Excel(name = "关联酒店", width = 15)
+    @ApiModelProperty(value = "关联酒店")
+    private String hotelId;
+	/**工号,唯一键*/
+	@Excel(name = "工号,唯一键", width = 15)
+    @ApiModelProperty(value = "工号,唯一键")
+    private String workNo;
+	/**姓名*/
+	@Excel(name = "姓名", width = 15)
+    @ApiModelProperty(value = "姓名")
+    private String name;
+	/**关联操作用户*/
+	@Excel(name = "关联操作用户", width = 15)
+    @ApiModelProperty(value = "关联操作用户")
+    private String operatorId;
+	/**联系电话*/
+	@Excel(name = "联系电话", width = 15)
+    @ApiModelProperty(value = "联系电话")
+    private String mobile;
+	/**手机号*/
+	@Excel(name = "手机号", width = 15)
+    @ApiModelProperty(value = "手机号")
+    private String phone;
+	/**地址*/
+	@Excel(name = "地址", width = 15)
+    @ApiModelProperty(value = "地址")
+    private String address;
+	/**状态(0-禁用;1-启用)*/
+	@Excel(name = "状态(0-禁用;1-启用)", width = 15)
+    @ApiModelProperty(value = "状态(0-禁用;1-启用)")
+    private Integer status;
+	/**备注信息*/
+	@Excel(name = "备注信息", width = 15)
+    @ApiModelProperty(value = "备注信息")
+    private String remarks;
+	/**删除状态(0-正常,1-已删除)*/
+	@Excel(name = "删除状态(0-正常,1-已删除)", width = 15)
+    @ApiModelProperty(value = "删除状态(0-正常,1-已删除)")
+    @TableLogic
+    private Integer delFlag;
+	/**创建人*/
+    @ApiModelProperty(value = "创建人")
+    private String createBy;
+	/**创建时间*/
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern="yyyy-MM-dd")
+    @ApiModelProperty(value = "创建时间")
+    private Date createTime;
+	/**更新人*/
+    @ApiModelProperty(value = "更新人")
+    private String updateBy;
+	/**更新时间*/
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern="yyyy-MM-dd")
+    @ApiModelProperty(value = "更新时间")
+    private Date updateTime;
+}

+ 37 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/BusDictItemMapper.java

@@ -0,0 +1,37 @@
+package org.jeecg.modules.business.mapper;
+
+import java.util.List;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.apache.ibatis.annotations.Param;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.jeecg.modules.business.entity.BusDictItem;
+import org.jeecg.modules.system.entity.SysUser;
+import org.jeecg.modules.system.model.SysUserSysDepartModel;
+
+/**
+ * @Description: 业务字典配置表
+ * @Author: jeecg-boot
+ * @Date:   2023-03-06
+ * @Version: V1.0
+ */
+public interface BusDictItemMapper extends BaseMapper<BusDictItem> {
+//    /**
+//     * 根据 dictId 查询字典值
+//     *
+//     * @param dictId
+//     * @param dictItemParams 查询条件,可为空
+//     * @param page 分页参数
+//     * @return
+//     */
+//    List<BusDictItem> queryItemByParentId(IPage page, @Param("dictId") String dictId, @Param("dictItemParams") BusDictItem dictItemParams);
+//
+//    /**
+//     * 查询 queryItemByParentId 的Total
+//     *
+//     * @param dictId
+//     * @param dictItemParams 查询条件,可为空
+//     * @return
+//     */
+//    Integer queryItemByParentIdTotal(@Param("dictId") String dictId, @Param("dictItemParams") BusDictItem dictItemParams);
+}

+ 17 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/BusDictMapper.java

@@ -0,0 +1,17 @@
+package org.jeecg.modules.business.mapper;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Param;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.jeecg.modules.business.entity.BusDict;
+
+/**
+ * @Description: 业务字典表
+ * @Author: jeecg-boot
+ * @Date:   2023-03-06
+ * @Version: V1.0
+ */
+public interface BusDictMapper extends BaseMapper<BusDict> {
+
+}

+ 17 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/BusSalesPersonMapper.java

@@ -0,0 +1,17 @@
+package org.jeecg.modules.business.mapper;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Param;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.jeecg.modules.business.entity.BusSalesPerson;
+
+/**
+ * @Description: 营销人员管理
+ * @Author: jeecg-boot
+ * @Date:   2023-03-06
+ * @Version: V1.0
+ */
+public interface BusSalesPersonMapper extends BaseMapper<BusSalesPerson> {
+
+}

+ 4 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/xml/BusDictItemMapper.xml

@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.jeecg.modules.demo.business.mapper.BusDictItemMapper">
+</mapper>

+ 5 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/xml/BusDictMapper.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.jeecg.modules.demo.business.mapper.BusDictMapper">
+
+</mapper>

+ 5 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/xml/BusSalesPersonMapper.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.jeecg.modules.demo.business.mapper.BusSalesPersonMapper">
+
+</mapper>

+ 284 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/model/BusDictTreeModel.java

@@ -0,0 +1,284 @@
+package org.jeecg.modules.business.model;
+
+import org.jeecg.modules.business.entity.BusDict;
+import org.jeecg.modules.system.entity.SysDepart;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Objects;
+
+/**
+ * <p>
+ * 字典表 存储树结构数据的实体类
+ * <p>
+ *
+ * @Author xq
+ * @Since 20230308
+ */
+public class BusDictTreeModel implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /** 对应bus_dict_info中的id字段,前端数据树中的key*/
+    private String key;
+
+    /** 对应bus_dict_info中的id字段,前端数据树中的value*/
+    private String value;
+
+    /** 对应bus_dict_info中的dict_name字段,前端数据树中的title*/
+    private String title;
+
+
+    private boolean isLeaf;
+    // 以下所有字段均与bus_dict_info相同
+
+    private String id;
+
+    private String parentId;
+
+    private String tenantId;
+
+    private String hotelId;
+
+    private String dictName;
+
+    private String dictCode;
+
+    private String description;
+
+    private Integer delFlag;
+
+    private String createBy;
+
+    private Date createTime;
+
+    private String updateBy;
+
+    private Date updateTime;
+    private Integer type;
+
+    private List<BusDictTreeModel> children = new ArrayList<>();
+
+
+    /**
+     * 将BusDict对象转换成BusDictTreeModel对象
+     * @param busDict
+     */
+    public BusDictTreeModel(BusDict busDict) {
+        this.key = busDict.getId();
+        this.value = busDict.getId();
+        this.title = busDict.getDictName();
+        this.id = busDict.getId();
+        this.parentId = busDict.getParentId();
+        this.tenantId = busDict.getTenantId();
+        this.hotelId = busDict.getHotelId();
+        this.dictName = busDict.getDictName();
+        this.dictCode = busDict.getDictCode();
+        this.description = busDict.getDescription();
+        this.delFlag = busDict.getDelFlag();
+        this.createBy = busDict.getCreateBy();
+        this.createTime = busDict.getCreateTime();
+        this.updateBy = busDict.getUpdateBy();
+        this.updateTime = busDict.getUpdateTime();
+        this.type = busDict.getType();
+    }
+
+    public boolean getIsLeaf() {
+        return isLeaf;
+    }
+
+    public void setIsLeaf(boolean isleaf) {
+        this.isLeaf = isleaf;
+    }
+
+    public String getKey() {
+        return key;
+    }
+
+
+    public void setKey(String key) {
+        this.key = key;
+    }
+
+
+    public String getValue() {
+        return value;
+    }
+
+
+    public void setValue(String value) {
+        this.value = value;
+    }
+
+
+    public String getTitle() {
+        return title;
+    }
+
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getParentId() {
+        return parentId;
+    }
+
+    public void setParentId(String parentId) {
+        this.parentId = parentId;
+    }
+
+    public List<BusDictTreeModel> getChildren() {
+        return children;
+    }
+
+    public void setChildren(List<BusDictTreeModel> children) {
+        if (children==null){
+            this.isLeaf=true;
+        }
+        this.children = children;
+    }
+
+    public String getTenantId() {
+        return tenantId;
+    }
+
+    public void setTenantId(String tenantId) {
+        this.tenantId = tenantId;
+    }
+
+    public static long getSerialVersionUID() {
+        return serialVersionUID;
+    }
+
+    public String getHotelId() {
+        return hotelId;
+    }
+
+    public void setHotelId(String hotelId) {
+        this.hotelId = hotelId;
+    }
+
+    public String getDictName() {
+        return dictName;
+    }
+
+    public void setDictName(String dictName) {
+        this.dictName = dictName;
+    }
+
+    public String getDictCode() {
+        return dictCode;
+    }
+
+    public void setDictCode(String dictCode) {
+        this.dictCode = dictCode;
+    }
+
+    public String getDescription() {
+        return description;
+    }
+
+    public void setDescription(String description) {
+        this.description = description;
+    }
+
+    public Integer getDelFlag() {
+        return delFlag;
+    }
+
+    public void setDelFlag(Integer delFlag) {
+        this.delFlag = delFlag;
+    }
+
+    public String getCreateBy() {
+        return createBy;
+    }
+
+    public void setCreateBy(String createBy) {
+        this.createBy = createBy;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public String getUpdateBy() {
+        return updateBy;
+    }
+
+    public void setUpdateBy(String updateBy) {
+        this.updateBy = updateBy;
+    }
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    public Integer getType() {
+        return type;
+    }
+
+    public void setType(Integer type) {
+        this.type = type;
+    }
+
+    /**
+     * 重写equals方法
+     */
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) {
+            return true;
+        }
+        if (o == null || getClass() != o.getClass()) {
+            return false;
+        }
+        BusDictTreeModel model = (BusDictTreeModel) o;
+        return Objects.equals(id, model.id) &&
+                Objects.equals(parentId, model.parentId) &&
+                Objects.equals(tenantId, model.tenantId) &&
+                Objects.equals(hotelId, model.hotelId) &&
+                Objects.equals(dictName, model.dictName) &&
+                Objects.equals(dictCode, model.dictCode) &&
+                Objects.equals(description, model.description) &&
+                Objects.equals(delFlag, model.delFlag) &&
+                Objects.equals(createBy, model.createBy) &&
+                Objects.equals(createTime, model.createTime) &&
+                Objects.equals(updateBy, model.updateBy) &&
+                Objects.equals(updateTime, model.updateTime) &&
+                Objects.equals(type, model.type) &&
+                Objects.equals(children, model.children);
+    }
+
+    /**
+     * 重写hashCode方法
+     */
+    @Override
+    public int hashCode() {
+
+        return Objects.hash(id, parentId,tenantId, hotelId, dictName, dictCode,
+                description, delFlag, createBy, createTime, updateBy, updateTime,type,
+                children);
+    }
+
+}

+ 100 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/model/DictIdModel.java

@@ -0,0 +1,100 @@
+package org.jeecg.modules.business.model;
+
+import org.jeecg.modules.business.entity.BusDict;
+import org.jeecg.modules.system.entity.SysDepart;
+import org.jeecg.modules.system.model.SysDepartTreeModel;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * <p>
+ * 字典表 封装树结构的字典的名称的实体类
+ * <p>
+ *
+ * @Author xq
+ * @Since 20230308
+ *
+ */
+public class DictIdModel implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键ID
+     */
+    private String key;
+
+    /**
+     * 主键ID
+     */
+    private String value;
+
+    /**
+     * 字典名称
+     */
+    private String title;
+
+    List<DictIdModel> children = new ArrayList<>();
+
+    /**
+     * 将BusDictTreeModel的部分数据放在该对象当中
+     * @param treeModel
+     * @return
+     */
+    public DictIdModel convert(BusDictTreeModel treeModel) {
+        this.key = treeModel.getId();
+        this.value = treeModel.getId();
+        this.title = treeModel.getDictName();
+        return this;
+    }
+
+    /**
+     * 该方法为字典的实现类所使用
+     * @param busDict
+     * @return
+     */
+    public DictIdModel convertByBusDict(BusDict busDict) {
+        this.key = busDict.getId();
+        this.value = busDict.getId();
+        this.title = busDict.getDictName();
+        return this;
+    }
+
+    public List<DictIdModel> getChildren() {
+        return children;
+    }
+
+    public void setChildren(List<DictIdModel> children) {
+        this.children = children;
+    }
+
+    public static long getSerialVersionUID() {
+        return serialVersionUID;
+    }
+
+    public String getKey() {
+        return key;
+    }
+
+    public void setKey(String key) {
+        this.key = key;
+    }
+
+    public String getValue() {
+        return value;
+    }
+
+    public void setValue(String value) {
+        this.value = value;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+}

+ 26 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/IBusDictItemService.java

@@ -0,0 +1,26 @@
+package org.jeecg.modules.business.service;
+
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.service.IService;
+import org.jeecg.modules.business.entity.BusDictItem;
+import org.jeecg.modules.system.entity.SysUser;
+import org.jeecg.modules.system.model.SysUserSysDepartModel;
+
+/**
+ * @Description: 业务字典配置表
+ * @Author: jeecg-boot
+ * @Date:   2023-03-06
+ * @Version: V1.0
+ */
+public interface IBusDictItemService extends IService<BusDictItem> {
+    /**
+     * 根据 dictId 查询字典值
+     *
+     * @param dictId
+     * @param dictItemParams 查询条件,可为空
+     * @param page 分页参数
+     * @return
+     */
+    IPage<BusDictItem> queryItemByParentId(String dictId, BusDictItem dictItemParams, IPage page);
+}

+ 28 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/IBusDictService.java

@@ -0,0 +1,28 @@
+package org.jeecg.modules.business.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import org.jeecg.modules.business.entity.BusDict;
+import org.jeecg.modules.business.model.BusDictTreeModel;
+import org.jeecg.modules.system.model.SysDepartTreeModel;
+
+import java.util.List;
+
+/**
+ * @Description: 业务字典表
+ * @Author: jeecg-boot
+ * @Date:   2023-03-06
+ * @Version: V1.0
+ */
+public interface IBusDictService extends IService<BusDict> {
+    /**
+     * 查询所有字典信息,并分节点进行显示
+     * @return
+     */
+    List<BusDictTreeModel> queryTreeList();
+    /**
+     * 查询所有部门信息,并分节点进行显示
+     * @param ids 多个部门id
+     * @return
+     */
+    List<BusDictTreeModel> queryTreeList(String ids);
+}

+ 15 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/IBusSalesPersonService.java

@@ -0,0 +1,15 @@
+package org.jeecg.modules.business.service;
+
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import org.jeecg.modules.business.entity.BusSalesPerson;
+
+/**
+ * @Description: 营销人员管理
+ * @Author: jeecg-boot
+ * @Date:   2023-03-06
+ * @Version: V1.0
+ */
+public interface IBusSalesPersonService extends IService<BusSalesPerson> {
+
+}

+ 36 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/impl/BusDictItemServiceImpl.java

@@ -0,0 +1,36 @@
+package org.jeecg.modules.business.service.impl;
+
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import org.jeecg.modules.business.entity.BusDictItem;
+import org.jeecg.modules.business.mapper.BusDictItemMapper;
+import org.jeecg.modules.business.service.IBusDictItemService;
+import org.jeecg.modules.system.entity.SysUser;
+import org.jeecg.modules.system.model.SysUserSysDepartModel;
+import org.springframework.stereotype.Service;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+
+import java.util.List;
+
+/**
+ * @Description: 业务字典配置表
+ * @Author: jeecg-boot
+ * @Date:   2023-03-06
+ * @Version: V1.0
+ */
+@Service
+public class BusDictItemServiceImpl extends ServiceImpl<BusDictItemMapper, BusDictItem> implements IBusDictItemService {
+    @Override
+    public IPage<BusDictItem> queryItemByParentId(String dictId, BusDictItem dictItemParams, IPage page) {
+//        List<BusDictItem> list = baseMapper.queryItemByParentId(page, dictId, dictItemParams);
+//        Integer total = baseMapper.queryItemByParentIdTotal(dictId, dictItemParams);
+//
+//        IPage<BusDictItem> result = new Page<>(page.getCurrent(), page.getSize(), total);
+//        result.setRecords(list);
+
+        IPage<BusDictItem> result = new Page<>();
+        return result;
+    }
+}

+ 68 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/impl/BusDictServiceImpl.java

@@ -0,0 +1,68 @@
+package org.jeecg.modules.business.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import org.jeecg.common.constant.CacheConstant;
+import org.jeecg.common.constant.CommonConstant;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecg.modules.business.entity.BusDict;
+import org.jeecg.modules.business.mapper.BusDictMapper;
+import org.jeecg.modules.business.model.BusDictTreeModel;
+import org.jeecg.modules.business.service.IBusDictService;
+import org.jeecg.modules.business.util.FindsBusDictsChildrenUtil;
+import org.jeecg.modules.system.entity.SysDepart;
+import org.jeecg.modules.system.model.SysDepartTreeModel;
+import org.jeecg.modules.system.util.FindsDepartsChildrenUtil;
+import org.springframework.cache.annotation.Cacheable;
+import org.springframework.stereotype.Service;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @Description: 业务字典表
+ * @Author: jeecg-boot
+ * @Date:   2023-03-06
+ * @Version: V1.0
+ */
+@Service
+public class BusDictServiceImpl extends ServiceImpl<BusDictMapper, BusDict> implements IBusDictService {
+    /**
+     * queryTreeList 对应 queryTreeList 查询所有的部门数据,以树结构形式响应给前端
+     */
+    @Override
+    public List<BusDictTreeModel> queryTreeList() {
+        LambdaQueryWrapper<BusDict> query = new LambdaQueryWrapper<BusDict>();
+        query.eq(BusDict::getDelFlag, CommonConstant.DEL_FLAG_0.toString());
+//        query.orderByAsc(BusDict::getCreateTime);
+        List<BusDict> list = this.list(query);
+        //update-begin---author:wangshuai ---date:20220307  for:[JTC-119]在部门管理菜单下设置部门负责人 创建用户的时候不需要处理
+        //设置用户id,让前台显示
+//        this.setUserIdsByDepList(list);
+        //update-begin---author:wangshuai ---date:20220307  for:[JTC-119]在部门管理菜单下设置部门负责人 创建用户的时候不需要处理
+        // 调用wrapTreeDataToTreeList方法生成树状数据
+        List<BusDictTreeModel> listResult = FindsBusDictsChildrenUtil.wrapTreeDataToTreeList(list);
+        return listResult;
+    }
+
+    /**
+     * queryTreeList 根据部门id查询,前端回显调用
+     */
+    @Override
+    public List<BusDictTreeModel> queryTreeList(String ids) {
+        List<BusDictTreeModel> listResult=new ArrayList<>();
+        LambdaQueryWrapper<BusDict> query = new LambdaQueryWrapper<BusDict>();
+        query.eq(BusDict::getDelFlag, CommonConstant.DEL_FLAG_0.toString());
+        if(oConvertUtils.isNotEmpty(ids)){
+            query.in(true,BusDict::getId,ids.split(","));
+        }
+//        query.orderByAsc(BusDict::getCreateTime);
+        List<BusDict> list= this.list(query);
+        for (BusDict depart : list) {
+            listResult.add(new BusDictTreeModel(depart));
+        }
+        return  listResult;
+
+    }
+}

+ 19 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/impl/BusSalesPersonServiceImpl.java

@@ -0,0 +1,19 @@
+package org.jeecg.modules.business.service.impl;
+
+import org.jeecg.modules.business.entity.BusSalesPerson;
+import org.jeecg.modules.business.mapper.BusSalesPersonMapper;
+import org.jeecg.modules.business.service.IBusSalesPersonService;
+import org.springframework.stereotype.Service;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+
+/**
+ * @Description: 营销人员管理
+ * @Author: jeecg-boot
+ * @Date:   2023-03-06
+ * @Version: V1.0
+ */
+@Service
+public class BusSalesPersonServiceImpl extends ServiceImpl<BusSalesPersonMapper, BusSalesPerson> implements IBusSalesPersonService {
+
+}

+ 187 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/util/FindsBusDictsChildrenUtil.java

@@ -0,0 +1,187 @@
+package org.jeecg.modules.business.util;
+
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecg.modules.business.entity.BusDict;
+import org.jeecg.modules.business.model.BusDictTreeModel;
+import org.jeecg.modules.business.model.DictIdModel;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class FindsBusDictsChildrenUtil {
+
+    /**
+     * queryTreeList的子方法 ====1=====
+     * 该方法是BusDict类型的list集合转换成BusDictTreeModel类型的集合
+     */
+    public static List<BusDictTreeModel> wrapTreeDataToTreeList(List<BusDict> recordList) {
+        // 在该方法每请求一次,都要对全局list集合进行一次清理
+        //idList.clear();
+        List<DictIdModel> idList = new ArrayList<DictIdModel>();
+        List<BusDictTreeModel> records = new ArrayList<>();
+        for (int i = 0; i < recordList.size(); i++) {
+            BusDict depart = recordList.get(i);
+            records.add(new BusDictTreeModel(depart));
+        }
+        List<BusDictTreeModel> tree = findChildren(records, idList);
+        setEmptyChildrenAsNull(tree);
+        return tree;
+    }
+
+    /**
+     * 获取 DictIdModel
+     * @param recordList
+     * @return
+     */
+    public static List<DictIdModel> wrapTreeDataToDepartIdTreeList(List<BusDict> recordList) {
+        // 在该方法每请求一次,都要对全局list集合进行一次清理
+        //idList.clear();
+        List<DictIdModel> idList = new ArrayList<DictIdModel>();
+        List<BusDictTreeModel> records = new ArrayList<>();
+        for (int i = 0; i < recordList.size(); i++) {
+            BusDict busDict = recordList.get(i);
+            records.add(new BusDictTreeModel(busDict));
+        }
+        findChildren(records, idList);
+        return idList;
+    }
+
+    /**
+     * queryTreeList的子方法 ====2=====
+     * 该方法是找到并封装顶级父类的节点到TreeList集合
+     */
+    private static List<BusDictTreeModel> findChildren(List<BusDictTreeModel> recordList,
+                                                         List<DictIdModel> dictIdList) {
+
+        List<BusDictTreeModel> treeList = new ArrayList<>();
+        for (int i = 0; i < recordList.size(); i++) {
+            BusDictTreeModel branch = recordList.get(i);
+            if (oConvertUtils.isEmpty(branch.getParentId())) {
+                treeList.add(branch);
+                DictIdModel departIdModel = new DictIdModel().convert(branch);
+                dictIdList.add(departIdModel);
+            }
+        }
+        getGrandChildren(treeList,recordList,dictIdList);
+
+        //idList = departIdList;
+        return treeList;
+    }
+
+    /**
+     * queryTreeList的子方法====3====
+     *该方法是找到顶级父类下的所有子节点集合并封装到TreeList集合
+     */
+    private static void getGrandChildren(List<BusDictTreeModel> treeList,List<BusDictTreeModel> recordList,List<DictIdModel> idList) {
+
+        for (int i = 0; i < treeList.size(); i++) {
+            BusDictTreeModel model = treeList.get(i);
+            DictIdModel idModel = idList.get(i);
+            for (int i1 = 0; i1 < recordList.size(); i1++) {
+                BusDictTreeModel m = recordList.get(i1);
+                if (m.getParentId()!=null && m.getParentId().equals(model.getId())) {
+                    model.getChildren().add(m);
+                    DictIdModel dim = new DictIdModel().convert(m);
+                    idModel.getChildren().add(dim);
+                }
+            }
+            getGrandChildren(treeList.get(i).getChildren(), recordList, idList.get(i).getChildren());
+        }
+
+    }
+
+
+    /**
+     * queryTreeList的子方法 ====4====
+     * 该方法是将子节点为空的List集合设置为Null值
+     */
+    private static void setEmptyChildrenAsNull(List<BusDictTreeModel> treeList) {
+
+        for (int i = 0; i < treeList.size(); i++) {
+            BusDictTreeModel model = treeList.get(i);
+            if (model.getChildren().size() == 0) {
+                model.setChildren(null);
+                model.setIsLeaf(true);
+            }else{
+                setEmptyChildrenAsNull(model.getChildren());
+                model.setIsLeaf(false);
+            }
+        }
+        // sysDepartTreeList = treeList;
+    }
+//    /**
+//     * queryTreeList的子方法 ====1=====
+//     * 该方法是将BusDict类型的list集合转换成BusDictTreeModel类型的集合
+//     */
+//    public static List<BusDictTreeModel> wrapTreeDataToTreeList(List<BusDict> recordList) {
+//        // 在该方法每请求一次,都要对全局list集合进行一次清理
+//        //idList.clear();
+//        List<DictIdModel> idList = new ArrayList<DictIdModel>();
+//        List<BusDictTreeModel> records = new ArrayList<>();
+//        for (int i = 0; i < recordList.size(); i++) {
+//            BusDict depart = recordList.get(i);
+//            records.add(new BusDictTreeModel(depart));
+//        }
+//        List<BusDictTreeModel> tree = findChildren(records, idList);
+//        setEmptyChildrenAsNull(tree);
+//        return tree;
+//    }
+//    /**
+//     * queryTreeList的子方法 ====2=====
+//     * 该方法是找到并封装顶级父类的节点到TreeList集合
+//     */
+//    private static List<BusDictTreeModel> findChildren(List<BusDictTreeModel> recordList,
+//                                                         List<DictIdModel> departIdList) {
+//
+//        List<BusDictTreeModel> treeList = new ArrayList<>();
+//        for (int i = 0; i < recordList.size(); i++) {
+//            BusDictTreeModel branch = recordList.get(i);
+//            if (oConvertUtils.isEmpty(branch.getParentId())) {
+//                treeList.add(branch);
+//                DictIdModel departIdModel = new DictIdModel().convert(branch);
+//                departIdList.add(departIdModel);
+//            }
+//            treeList.add(branch);
+//        }
+//        getGrandChildren(treeList,recordList);
+//
+//        //idList = departIdList;
+//        return treeList;
+//    }
+//    /**
+//     * queryTreeList的子方法====3====
+//     *该方法是找到顶级父类下的所有子节点集合并封装到TreeList集合
+//     */
+//    private static void getGrandChildren(List<BusDictTreeModel> treeList,List<BusDictTreeModel> recordList) {
+//
+//        for (int i = 0; i < treeList.size(); i++) {
+//            BusDictTreeModel model = treeList.get(i);
+//            for (int i1 = 0; i1 < recordList.size(); i1++) {
+//                BusDictTreeModel m = recordList.get(i1);
+//                if (m.getParentId()!=null && m.getParentId().equals(model.getId())) {
+//                    model.getChildren().add(m);
+//                }
+//            }
+//            getGrandChildren(treeList.get(i).getChildren(), recordList);
+//        }
+//
+//    }
+//    /**
+//     * queryTreeList的子方法 ====4====
+//     * 该方法是将子节点为空的List集合设置为Null值
+//     */
+//    private static void setEmptyChildrenAsNull(List<BusDictTreeModel> treeList) {
+//
+//        for (int i = 0; i < treeList.size(); i++) {
+//            BusDictTreeModel model = treeList.get(i);
+//            if (model.getChildren().size() == 0) {
+//                model.setChildren(null);
+//                model.setIsLeaf(true);
+//            }else{
+//                setEmptyChildrenAsNull(model.getChildren());
+//                model.setIsLeaf(false);
+//            }
+//        }
+////         sysDepartTreeList = treeList;
+//    }
+}