|
|
@ -21,6 +21,7 @@ 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.commons.tools.constant.StrConstant; |
|
|
|
import com.epmet.dataaggre.constant.DataSourceConstant; |
|
|
|
import com.epmet.dataaggre.dao.opercustomize.CustomerFootBarDao; |
|
|
|
import com.epmet.dataaggre.dto.app.form.AppFootBarFormDTO; |
|
|
@ -70,28 +71,35 @@ public class CustomerFootBarServiceImpl extends BaseServiceImpl<CustomerFootBarD |
|
|
|
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()); |
|
|
|
}else{ |
|
|
|
//如果客户没有上传图标,返回产品默认的图标
|
|
|
|
for (CustomerFootBarDTO dto : footBarList) { |
|
|
|
if (StringUtils.isBlank(dto.getIconPath()) |
|
|
|
|| StringUtils.isBlank(dto.getSelectedIconPath()) |
|
|
|
|| StringUtils.isBlank(dto.getFloatIconPath())) { |
|
|
|
CustomerFootBarEntity defaultEntity = baseDao.selectDefaultIcon(Constant.DEFAULT_CUSTOMER, footBarFormDTO.getAppType(), dto.getBarKey()); |
|
|
|
if (StringUtils.isBlank(dto.getIconPath())) { |
|
|
|
dto.setIconPath(null == defaultEntity ? StrConstant.EPMETY_STR : defaultEntity.getIconPath()); |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(dto.getSelectedIconPath())) { |
|
|
|
dto.setSelectedIconPath(null == defaultEntity ? StrConstant.EPMETY_STR : defaultEntity.getSelectedIconPath()); |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(dto.getFloatIconPath())) { |
|
|
|
dto.setFloatIconPath(null == defaultEntity ? StrConstant.EPMETY_STR : defaultEntity.getFloatIconPath()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
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())) { |
|
|
|
if (resultDTO.getIsOddNum() && Constant.FOOT_BAR_FLOAT.equals(patternEntity.getParameterValue())) { |
|
|
|
resultDTO.setPattern(Constant.FOOT_BAR_FLOAT); |
|
|
|
//返回
|
|
|
|
resultDTO.setHighLightNum(footBarList.size() / NumConstant.TWO); |
|
|
|