forked from rongchao/epmet-cloud-rizhao
27 changed files with 900 additions and 24 deletions
@ -0,0 +1,27 @@ |
|||||
|
package com.epmet.dataaggre.dto.app.form; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.NotBlank; |
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* 查询底部footBar信息(两端通用) |
||||
|
* |
||||
|
* @author yinzuomei@elink-cn.com |
||||
|
* @date 2021/7/27 18:54 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class AppFootBarFormDTO implements Serializable { |
||||
|
public interface AddUserInternalGroup {} |
||||
|
/** |
||||
|
* 产品配置:default; 客户定制化里面就传客户id |
||||
|
*/ |
||||
|
@NotBlank(message = "customerId不能为空",groups = AddUserInternalGroup.class) |
||||
|
private String customerId; |
||||
|
/** |
||||
|
* 工作端:gov;居民端resi |
||||
|
*/ |
||||
|
@NotBlank(message = "appType不能为空",groups = AddUserInternalGroup.class) |
||||
|
private String appType; |
||||
|
} |
@ -0,0 +1,39 @@ |
|||||
|
package com.epmet.dataaggre.dto.app.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 查询底部footBar信息(两端通用) |
||||
|
* |
||||
|
* @author yinzuomei@elink-cn.com |
||||
|
* @date 2021/7/27 19:00 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class AppFootBarResultDTO implements Serializable { |
||||
|
private static final long serialVersionUID = -2219461245919203814L; |
||||
|
|
||||
|
/** |
||||
|
* 水平:flat;浮起:float |
||||
|
*/ |
||||
|
private String pattern; |
||||
|
/** |
||||
|
* 默认返回0,如果是浮起模式且是奇数,返回是footBarList的索引 |
||||
|
*/ |
||||
|
private Integer highLightNum; |
||||
|
|
||||
|
|
||||
|
private List<CustomerFootBarDTO> footBarList; |
||||
|
|
||||
|
/** |
||||
|
* 是否是奇数,true:是奇数 |
||||
|
*/ |
||||
|
private Boolean isOddNum; |
||||
|
|
||||
|
/** |
||||
|
* 是否都上传了图标,true:都上传了 |
||||
|
*/ |
||||
|
private Boolean bothUploaded; |
||||
|
} |
@ -0,0 +1,49 @@ |
|||||
|
package com.epmet.dataaggre.dto.app.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* 查询底部footBar信息(两端通用) |
||||
|
* |
||||
|
* @author yinzuomei@elink-cn.com |
||||
|
* @date 2021/7/27 19:01 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class CustomerFootBarDTO implements Serializable { |
||||
|
/** |
||||
|
* KEY |
||||
|
*/ |
||||
|
private String barKey; |
||||
|
|
||||
|
/** |
||||
|
* bar名称 |
||||
|
*/ |
||||
|
private String barName; |
||||
|
|
||||
|
/** |
||||
|
* 页面标题 |
||||
|
*/ |
||||
|
private String pageTitle; |
||||
|
|
||||
|
/** |
||||
|
* 图标路径 |
||||
|
*/ |
||||
|
private String iconPath; |
||||
|
|
||||
|
/** |
||||
|
* 选中页面图标路径 |
||||
|
*/ |
||||
|
private String selectedIconPath; |
||||
|
|
||||
|
/** |
||||
|
* 凸起时图标路径 |
||||
|
*/ |
||||
|
private String floatIconPath; |
||||
|
|
||||
|
/** |
||||
|
* 客户id |
||||
|
*/ |
||||
|
private String customerId; |
||||
|
} |
@ -0,0 +1,40 @@ |
|||||
|
package com.epmet.dataaggre.controller; |
||||
|
|
||||
|
import com.epmet.commons.tools.utils.Result; |
||||
|
import com.epmet.commons.tools.validator.ValidatorUtils; |
||||
|
import com.epmet.dataaggre.dto.app.form.AppFootBarFormDTO; |
||||
|
import com.epmet.dataaggre.dto.app.result.AppFootBarResultDTO; |
||||
|
import com.epmet.dataaggre.service.opercustomize.CustomerFootBarService; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.PostMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestBody; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.RestController; |
||||
|
|
||||
|
/** |
||||
|
* 小程序相关配置,可以放在这,目前只放了footbar |
||||
|
* |
||||
|
* @author yinzuomei@elink-cn.com |
||||
|
* @date 2021/7/27 18:36 |
||||
|
*/ |
||||
|
@RestController |
||||
|
@RequestMapping("app") |
||||
|
public class AppController { |
||||
|
@Autowired |
||||
|
private CustomerFootBarService customerFootBarService; |
||||
|
|
||||
|
/** |
||||
|
* 查询底部footBar信息(两端通用) |
||||
|
* |
||||
|
* @param footBarFormDTO |
||||
|
* @return com.epmet.dataaggre.dto.app.result.AppFootBarResultDTO |
||||
|
* @author yinzuomei |
||||
|
* @date 2021/7/27 18:59 |
||||
|
*/ |
||||
|
@PostMapping("footbars") |
||||
|
public Result<AppFootBarResultDTO> queryAppFootBars(@RequestBody AppFootBarFormDTO footBarFormDTO){ |
||||
|
ValidatorUtils.validateEntity(footBarFormDTO,AppFootBarFormDTO.AddUserInternalGroup.class); |
||||
|
AppFootBarResultDTO resultDTO=customerFootBarService.queryAppFootBars(footBarFormDTO); |
||||
|
return new Result<AppFootBarResultDTO>().ok(resultDTO); |
||||
|
} |
||||
|
} |
@ -0,0 +1,43 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.dataaggre.dao.opercrm; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.dao.BaseDao; |
||||
|
import com.epmet.dataaggre.entity.opercrm.CustomerParameterEntity; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
|
||||
|
/** |
||||
|
* 客户配置表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2021-07-27 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface CustomerParameterDao extends BaseDao<CustomerParameterEntity> { |
||||
|
/** |
||||
|
* 根据参数key查询 |
||||
|
* |
||||
|
* @param parameterKey |
||||
|
* @param customerId |
||||
|
* @return java.lang.String |
||||
|
* @author yinzuomei |
||||
|
* @date 2021/7/27 17:07 |
||||
|
*/ |
||||
|
CustomerParameterEntity selectByParameterKey(@Param("parameterKey")String parameterKey, @Param("customerId")String customerId); |
||||
|
} |
@ -0,0 +1,38 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.dataaggre.dao.opercustomize; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.dao.BaseDao; |
||||
|
import com.epmet.dataaggre.dto.app.result.CustomerFootBarDTO; |
||||
|
import com.epmet.dataaggre.entity.opercustomize.CustomerFootBarEntity; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* APP底部菜单栏信息 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2021-07-27 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface CustomerFootBarDao extends BaseDao<CustomerFootBarEntity> { |
||||
|
|
||||
|
List<CustomerFootBarDTO> selectAppFootBars(@Param("customerId") String customerId, @Param("appType") String appType); |
||||
|
} |
@ -0,0 +1,68 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.dataaggre.entity.opercrm; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
|
||||
|
/** |
||||
|
* 客户配置表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2021-07-27 |
||||
|
*/ |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper=false) |
||||
|
@TableName("customer_parameter") |
||||
|
public class CustomerParameterEntity extends BaseEpmetEntity { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 客户ID |
||||
|
*/ |
||||
|
private String customerId; |
||||
|
|
||||
|
/** |
||||
|
* 参数KEY值(发短信:send_msg;) |
||||
|
*/ |
||||
|
private String parameterKey; |
||||
|
|
||||
|
/** |
||||
|
* 参数名称(短信) |
||||
|
*/ |
||||
|
private String parameterName; |
||||
|
|
||||
|
/** |
||||
|
* 参数开关:开启:on,关闭:off |
||||
|
*/ |
||||
|
private String parameterSwitch; |
||||
|
|
||||
|
/** |
||||
|
* 参数VALUE值 |
||||
|
*/ |
||||
|
private String parameterValue; |
||||
|
|
||||
|
/** |
||||
|
* 说明 |
||||
|
*/ |
||||
|
private String description; |
||||
|
|
||||
|
} |
@ -0,0 +1,88 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.dataaggre.entity.opercustomize; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
|
||||
|
/** |
||||
|
* APP底部菜单栏信息 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2021-07-27 |
||||
|
*/ |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper=false) |
||||
|
@TableName("customer_foot_bar") |
||||
|
public class CustomerFootBarEntity extends BaseEpmetEntity { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 客户ID |
||||
|
*/ |
||||
|
private String customerId; |
||||
|
|
||||
|
/** |
||||
|
* 工作端:gov居民端:resi |
||||
|
*/ |
||||
|
private String appType; |
||||
|
|
||||
|
/** |
||||
|
* KEY |
||||
|
*/ |
||||
|
private String barKey; |
||||
|
|
||||
|
/** |
||||
|
* bar名称 |
||||
|
*/ |
||||
|
private String barName; |
||||
|
|
||||
|
/** |
||||
|
* 页面标题 |
||||
|
*/ |
||||
|
private String pageTitle; |
||||
|
|
||||
|
/** |
||||
|
* 图标路径 |
||||
|
*/ |
||||
|
private String iconPath; |
||||
|
|
||||
|
/** |
||||
|
* 选中页面图标路径 |
||||
|
*/ |
||||
|
private String selectedIconPath; |
||||
|
|
||||
|
/** |
||||
|
* 凸起时图标路径 |
||||
|
*/ |
||||
|
private String floatIconPath; |
||||
|
|
||||
|
/** |
||||
|
* 是否显示。1:显示,0:隐藏 |
||||
|
*/ |
||||
|
private Integer display; |
||||
|
|
||||
|
/** |
||||
|
* 排序 |
||||
|
*/ |
||||
|
private Integer orderIndex; |
||||
|
|
||||
|
} |
@ -0,0 +1,34 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.dataaggre.service.opercrm; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.service.BaseService; |
||||
|
import com.epmet.dataaggre.entity.opercrm.CustomerParameterEntity; |
||||
|
|
||||
|
/** |
||||
|
* 客户配置表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2021-07-27 |
||||
|
*/ |
||||
|
public interface CustomerParameterService extends BaseService<CustomerParameterEntity> { |
||||
|
|
||||
|
CustomerParameterEntity queryFootBarPattern(String customerId, String appType); |
||||
|
|
||||
|
CustomerParameterEntity queryFootBarHighLightNum(String customerId, String appType); |
||||
|
} |
@ -0,0 +1,60 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.dataaggre.service.opercrm.impl; |
||||
|
|
||||
|
import com.epmet.commons.dynamic.datasource.annotation.DataSource; |
||||
|
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
||||
|
import com.epmet.commons.tools.constant.Constant; |
||||
|
import com.epmet.dataaggre.constant.DataSourceConstant; |
||||
|
import com.epmet.dataaggre.dao.opercrm.CustomerParameterDao; |
||||
|
import com.epmet.dataaggre.entity.opercrm.CustomerParameterEntity; |
||||
|
import com.epmet.dataaggre.service.opercrm.CustomerParameterService; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
/** |
||||
|
* 客户配置表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2021-07-27 |
||||
|
*/ |
||||
|
@DataSource(DataSourceConstant.OPER_CRM) |
||||
|
@Slf4j |
||||
|
@Service |
||||
|
public class CustomerParameterServiceImpl extends BaseServiceImpl<CustomerParameterDao, CustomerParameterEntity> implements CustomerParameterService { |
||||
|
|
||||
|
@Override |
||||
|
public CustomerParameterEntity queryFootBarPattern(String customerId, String appType) { |
||||
|
String parameterKey=appType.concat(Constant.FOOTBAR_PATTERN_KEY_SUFFIX); |
||||
|
CustomerParameterEntity pattern=baseDao.selectByParameterKey(parameterKey,customerId); |
||||
|
if(null ==pattern){ |
||||
|
pattern=baseDao.selectByParameterKey(parameterKey, Constant.DEFAULT_CUSTOMER); |
||||
|
} |
||||
|
return pattern; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public CustomerParameterEntity queryFootBarHighLightNum(String customerId, String appType) { |
||||
|
String parameterKey=appType.concat(Constant.FOOTBAR_HIGHLIGHT_NUM); |
||||
|
CustomerParameterEntity entity=baseDao.selectByParameterKey(parameterKey,customerId); |
||||
|
if(null ==entity){ |
||||
|
entity=baseDao.selectByParameterKey(parameterKey, Constant.DEFAULT_CUSTOMER); |
||||
|
} |
||||
|
return entity; |
||||
|
} |
||||
|
} |
@ -0,0 +1,42 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.dataaggre.service.opercustomize; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.service.BaseService; |
||||
|
import com.epmet.dataaggre.dto.app.form.AppFootBarFormDTO; |
||||
|
import com.epmet.dataaggre.dto.app.result.AppFootBarResultDTO; |
||||
|
import com.epmet.dataaggre.entity.opercustomize.CustomerFootBarEntity; |
||||
|
|
||||
|
/** |
||||
|
* APP底部菜单栏信息 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2021-07-27 |
||||
|
*/ |
||||
|
public interface CustomerFootBarService extends BaseService<CustomerFootBarEntity> { |
||||
|
|
||||
|
/** |
||||
|
* 查询底部footBar信息(两端通用) |
||||
|
* |
||||
|
* @param footBarFormDTO |
||||
|
* @return com.epmet.dataaggre.dto.app.result.AppFootBarResultDTO |
||||
|
* @author yinzuomei |
||||
|
* @date 2021/7/27 18:59 |
||||
|
*/ |
||||
|
AppFootBarResultDTO queryAppFootBars(AppFootBarFormDTO footBarFormDTO); |
||||
|
} |
@ -0,0 +1,107 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.dataaggre.service.opercustomize.impl; |
||||
|
|
||||
|
import com.epmet.commons.dynamic.datasource.annotation.DataSource; |
||||
|
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
||||
|
import com.epmet.commons.tools.constant.Constant; |
||||
|
import com.epmet.commons.tools.constant.NumConstant; |
||||
|
import com.epmet.dataaggre.constant.DataSourceConstant; |
||||
|
import com.epmet.dataaggre.dao.opercustomize.CustomerFootBarDao; |
||||
|
import com.epmet.dataaggre.dto.app.form.AppFootBarFormDTO; |
||||
|
import com.epmet.dataaggre.dto.app.result.AppFootBarResultDTO; |
||||
|
import com.epmet.dataaggre.dto.app.result.CustomerFootBarDTO; |
||||
|
import com.epmet.dataaggre.entity.opercrm.CustomerParameterEntity; |
||||
|
import com.epmet.dataaggre.entity.opercustomize.CustomerFootBarEntity; |
||||
|
import com.epmet.dataaggre.service.opercrm.CustomerParameterService; |
||||
|
import com.epmet.dataaggre.service.opercustomize.CustomerFootBarService; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.apache.commons.lang3.StringUtils; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import org.springframework.util.CollectionUtils; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* APP底部菜单栏信息 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2021-07-27 |
||||
|
*/ |
||||
|
@DataSource(DataSourceConstant.OPERCUSTOMIZE) |
||||
|
@Slf4j |
||||
|
@Service |
||||
|
public class CustomerFootBarServiceImpl extends BaseServiceImpl<CustomerFootBarDao, CustomerFootBarEntity> implements CustomerFootBarService { |
||||
|
|
||||
|
@Autowired |
||||
|
private CustomerParameterService customerParameterService; |
||||
|
|
||||
|
/** |
||||
|
* 查询底部footBar信息(两端通用) |
||||
|
* |
||||
|
* @param footBarFormDTO |
||||
|
* @return com.epmet.dataaggre.dto.app.result.AppFootBarResultDTO |
||||
|
* @author yinzuomei |
||||
|
* @date 2021/7/27 18:59 |
||||
|
*/ |
||||
|
@Override |
||||
|
public AppFootBarResultDTO queryAppFootBars(AppFootBarFormDTO footBarFormDTO) { |
||||
|
AppFootBarResultDTO resultDTO = new AppFootBarResultDTO(); |
||||
|
resultDTO.setPattern(Constant.FOOT_BAR_FLAT); |
||||
|
resultDTO.setHighLightNum(NumConstant.ZERO); |
||||
|
// 1、查询客户的模式,没有返回产品默认的;*水平:flat;浮起:float
|
||||
|
CustomerParameterEntity patternEntity = customerParameterService.queryFootBarPattern(footBarFormDTO.getCustomerId(), footBarFormDTO.getAppType()); |
||||
|
// 2、查询客户设置的第几个,没有默认返回0,
|
||||
|
CustomerParameterEntity highLightNumEntity = customerParameterService.queryFootBarHighLightNum(footBarFormDTO.getCustomerId(), footBarFormDTO.getAppType()); |
||||
|
// todo 这个sql需要修改
|
||||
|
List<CustomerFootBarDTO> footBarList = baseDao.selectAppFootBars(footBarFormDTO.getCustomerId(), footBarFormDTO.getAppType()); |
||||
|
if (CollectionUtils.isEmpty(footBarList)) { |
||||
|
footBarList = baseDao.selectAppFootBars(Constant.DEFAULT_CUSTOMER, footBarFormDTO.getAppType()); |
||||
|
} |
||||
|
if (footBarList.size() % NumConstant.TWO == 0) { |
||||
|
resultDTO.setIsOddNum(false); |
||||
|
} else { |
||||
|
resultDTO.setIsOddNum(true); |
||||
|
} |
||||
|
//避免产品默认的没有上传全图标
|
||||
|
resultDTO.setBothUploaded(true); |
||||
|
for (CustomerFootBarDTO entity : footBarList) { |
||||
|
if (StringUtils.isBlank(entity.getIconPath()) |
||||
|
|| StringUtils.isBlank(entity.getSelectedIconPath()) |
||||
|
|| StringUtils.isBlank(entity.getFloatIconPath())) { |
||||
|
resultDTO.setBothUploaded(false); |
||||
|
break; |
||||
|
} |
||||
|
} |
||||
|
//只有客户选择的浮起+奇数+全部上传了图标才返回pattern=flat
|
||||
|
if (resultDTO.getIsOddNum() && resultDTO.getBothUploaded() && Constant.FOOT_BAR_FLOAT.equals(patternEntity.getParameterValue())) { |
||||
|
resultDTO.setPattern(Constant.FOOT_BAR_FLOAT); |
||||
|
//返回
|
||||
|
resultDTO.setHighLightNum(footBarList.size() / NumConstant.TWO); |
||||
|
} else { |
||||
|
resultDTO.setPattern(Constant.FOOT_BAR_FLAT); |
||||
|
resultDTO.setHighLightNum(Integer.valueOf(highLightNumEntity.getParameterValue())); |
||||
|
} |
||||
|
//如果是浮起模式且是奇数,返回是footBarList的索引
|
||||
|
resultDTO.setFootBarList(footBarList); |
||||
|
return resultDTO; |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,15 @@ |
|||||
|
<?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="com.epmet.dataaggre.dao.opercrm.CustomerParameterDao"> |
||||
|
<select id="selectByParameterKey" parameterType="map" resultType="com.epmet.dataaggre.entity.opercrm.CustomerParameterEntity"> |
||||
|
select |
||||
|
cp.* |
||||
|
from customer_parameter cp |
||||
|
where cp.DEL_FLAG='0' |
||||
|
and cp.CUSTOMER_ID=#{customerId} |
||||
|
and cp.PARAMETER_KEY=#{parameterKey} |
||||
|
</select> |
||||
|
|
||||
|
|
||||
|
</mapper> |
@ -0,0 +1,25 @@ |
|||||
|
<?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="com.epmet.dataaggre.dao.opercustomize.CustomerFootBarDao"> |
||||
|
|
||||
|
<select id="selectAppFootBars" parameterType="map" resultType="com.epmet.dataaggre.dto.app.result.CustomerFootBarDTO"> |
||||
|
SELECT |
||||
|
c.BAR_KEY as barKey, |
||||
|
c.BAR_NAME as barName, |
||||
|
IFNULL(c.PAGE_TITLE,'') as pageTitle, |
||||
|
IFNULL(c.ICON_PATH,'') as iconPath, |
||||
|
IFNULL(c.SELECTED_ICON_PATH,'') as selectedIconPath, |
||||
|
IFNULL(c.FLOAT_ICON_PATH,'') AS floatIconPath, |
||||
|
c.CUSTOMER_ID as customerId |
||||
|
FROM |
||||
|
customer_foot_bar c |
||||
|
WHERE |
||||
|
c.del_flag = '0' |
||||
|
AND c.customer_id = #{customerId} |
||||
|
AND c.app_type = #{appType} |
||||
|
AND C.DISPLAY='1' |
||||
|
order by c.ORDER_INDEX asc |
||||
|
</select> |
||||
|
|
||||
|
</mapper> |
@ -0,0 +1,21 @@ |
|||||
|
package com.epmet.dto.form; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.NotBlank; |
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* 描述一下 |
||||
|
* |
||||
|
* @author yinzuomei@elink-cn.com |
||||
|
* @date 2021/7/28 9:39 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class NotOnlineFootBarFormDTO implements Serializable { |
||||
|
private static final long serialVersionUID = -4103181048360051521L; |
||||
|
@NotBlank(message = "客户id不能为空") |
||||
|
private String customerId; |
||||
|
@NotBlank(message = "appType不能为空") |
||||
|
private String appType; |
||||
|
} |
Loading…
Reference in new issue