From e47036c04e7445d35059800f814f64ee4f653f00 Mon Sep 17 00:00:00 2001 From: cuibaocheng Date: Fri, 13 Aug 2021 14:43:11 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=8A=A8=E6=80=81=E8=A1=A8?= =?UTF-8?q?=E5=8D=95=E8=87=AA=E5=8A=A8=E6=8E=92=E7=89=88=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E7=95=8C=E9=9D=A2=E7=9A=84=E4=BF=9D=E5=AD=98=E5=9B=9E=E6=98=BE?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ShopTemplateConfigAppController.java | 70 ++++++++++++++----- 1 file changed, 54 insertions(+), 16 deletions(-) diff --git a/src/main/java/cn/com/tenlion/systemcard/controller/app/api/shoptemplateconfig/ShopTemplateConfigAppController.java b/src/main/java/cn/com/tenlion/systemcard/controller/app/api/shoptemplateconfig/ShopTemplateConfigAppController.java index 6228f12..111c6f8 100644 --- a/src/main/java/cn/com/tenlion/systemcard/controller/app/api/shoptemplateconfig/ShopTemplateConfigAppController.java +++ b/src/main/java/cn/com/tenlion/systemcard/controller/app/api/shoptemplateconfig/ShopTemplateConfigAppController.java @@ -1,5 +1,8 @@ package cn.com.tenlion.systemcard.controller.app.api.shoptemplateconfig; +import cn.com.tenlion.configcolumn.service.configcolumn.IConfigColumnService; +import cn.com.tenlion.configtable.pojo.dtos.configtableoperation.ConfigTableOperationDTO; +import cn.com.tenlion.configtable.pojo.dtos.configtableoperation.ConfigTableOperationGroupDTO; import cn.com.tenlion.projectconfig.util.ProjectConfigUtil; import cn.com.tenlion.systemcard.dao.cardtemplateuse.ICardTemplateUseDao; import cn.com.tenlion.systemcard.pojo.dtos.cardtemplateuse.CardTemplateUseDTO; @@ -47,6 +50,9 @@ public class ShopTemplateConfigAppController extends DefaultBaseController { @Autowired private ICardTemplateUseService iCardTemplateUseService; + @Autowired + private IConfigColumnService configColumnService; + @ApiOperation(value = "服务页面的跳转", notes = "服务页面的跳转接口") @ApiImplicitParams({ @ApiImplicitParam(name = "creator", value = "当前名片创建人的ID", paramType = "query") @@ -55,31 +61,63 @@ public class ShopTemplateConfigAppController extends DefaultBaseController { @GetMapping("page" + ISystemConstant.RELEASE_SUFFIX + "/{userId}") public ModelAndView page(@PathVariable("userId") String userId) { ModelAndView modelAndView = new ModelAndView("shoptemplateconfig/baseinfo"); - List fileList = new ArrayList(); - fileList.add("8b4bc4ac-1ad0-4c12-b034-e0cb6ee755d8"); - fileList.add("fe02a4da-297e-4610-b38c-4179b2640f7d"); - modelAndView.addObject("fileList", fileList); - + modelAndView.addObject("content", "尚未设置默认名片"); + Map params = requestParams(); // 如果商店跳转开启 , 则查询商店进行跳转 if(ProjectConfigUtil.getSwitch("shopTargetSwitch")) { // 如果创建了商店 , 则跳转至商店的静态页 , 如果没有创建则接着往下走 modelAndView.setViewName("shoptemplateconfig/shoptest"); return modelAndView; } - // 如果当前访问的是系统默认名片 - CardTemplateUseDTO cardTemplateUseDTO = iCardTemplateUseService.getSystemCard(); - if(cardTemplateUseDTO != null && userId.equals(cardTemplateUseDTO.getCreator())) { - // 显示公司介绍页面 - modelAndView.setViewName("shoptemplateconfig/companyinfo"); - // 查询当前人在栏目中发布的商家信息 - return modelAndView; - } // 如果访问的是某人的名片 CardTemplateUseDTO cardTemplateUseDTOTop = iCardTemplateUseService.getTopCard(userId); if(cardTemplateUseDTOTop != null && userId.equals(cardTemplateUseDTOTop.getCreator())) { - modelAndView.setViewName("shoptemplateconfig/companyinfo"); - // 显示个人介绍页面 - return modelAndView; + params.put("userId", cardTemplateUseDTOTop.getCreator()); + List list = configColumnService.listDataByCode(null, ProjectConfigUtil.getText("companyColumnCode"), params); + if(list.size() > 0) { + // 显示公司介绍页面 + modelAndView.setViewName("shoptemplateconfig/companyinfo"); + List operationDTOList = list.get(0).getList(); + for(ConfigTableOperationDTO operationDTO : operationDTOList) { + // 公司图片 + if("photo".equals(operationDTO.getName()) ) { + String[] imageList = (operationDTO.getValue() + "" ).split(","); + modelAndView.addObject("fileList", imageList); + } + // 公司介绍 + if("content".equals(operationDTO.getName()) ) { + modelAndView.addObject("content", operationDTO.getValue() + ""); + } + } + // 查询当前人在栏目中发布的商家信息 + return modelAndView; + } + } + // 如果当前访问的是系统默认名片 + CardTemplateUseDTO cardTemplateUseDTO = iCardTemplateUseService.getSystemCard(); + if(cardTemplateUseDTO != null) { + params.put("userId", cardTemplateUseDTO.getCreator()); + List list = configColumnService.listDataByCode(null, ProjectConfigUtil.getText("companyColumnCode"), params); + if(list.size() > 0) { + // 显示公司介绍页面 + modelAndView.setViewName("shoptemplateconfig/companyinfo"); + List operationDTOList = list.get(0).getList(); + for(ConfigTableOperationDTO operationDTO : operationDTOList) { + // 公司图片 + if("photo".equals(operationDTO.getName()) ) { + String[] imageList = (operationDTO.getValue() + "" ).split(","); + modelAndView.addObject("fileList", imageList); + } + // 公司介绍 + if("content".equals(operationDTO.getName()) ) { + modelAndView.addObject("content", operationDTO.getValue() + ""); + } + } + // 查询当前人在栏目中发布的商家信息 + return modelAndView; + }else{ + modelAndView.addObject("content", "尚未发布公司信息"); + } } // 首次初始化没有默认名片跳转到空白页 return modelAndView;