|
|
@ -20,6 +20,7 @@ package com.epmet.service.impl; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|
|
|
import com.epmet.commons.tools.constant.Constant; |
|
|
|
import com.epmet.commons.tools.constant.FieldConstant; |
|
|
|
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|
|
|
import com.epmet.commons.tools.exception.RenException; |
|
|
@ -33,6 +34,7 @@ import com.epmet.dto.CustomerFootBarDTO; |
|
|
|
import com.epmet.dto.form.CheckFloatFootBarFormDTO; |
|
|
|
import com.epmet.dto.form.CustomerFootBarFormDTO; |
|
|
|
import com.epmet.dto.form.NotOnlineFootBarFormDTO; |
|
|
|
import com.epmet.dto.form.SyncFootBar4CustomerFormDTO; |
|
|
|
import com.epmet.dto.result.CheckFloatFootBarResultDTO; |
|
|
|
import com.epmet.dto.result.CustomerFootBarResultDTO; |
|
|
|
import com.epmet.entity.CustomerFootBarEntity; |
|
|
@ -344,23 +346,41 @@ public class CustomerFootBarServiceImpl extends BaseServiceImpl<CustomerFootBarD |
|
|
|
* @author yinzuomei |
|
|
|
* @date 2021/7/28 10:01 |
|
|
|
*/ |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
@Override |
|
|
|
public void createFootBarCustomer(CustomerFootBarFormDTO form) { |
|
|
|
|
|
|
|
validateBeforeCreate(form); |
|
|
|
|
|
|
|
CustomerFootBarEntity entity = new CustomerFootBarEntity(); |
|
|
|
entity.setAppType(form.getAppType()); |
|
|
|
entity.setCustomerId(form.getCustomerId()); |
|
|
|
entity.setBarKey(form.getBarKey()); |
|
|
|
entity.setBarName(form.getBarName()); |
|
|
|
entity.setIconPath(form.getIconPath()); |
|
|
|
entity.setPageTitle(form.getPageTitle()); |
|
|
|
entity.setSelectedIconPath(form.getSelectedIconPath()); |
|
|
|
entity.setOrderIndex(baseDao.fetchNextOrder(form.getCustomerId(), form.getAppType())); |
|
|
|
entity.setDisplay(true); |
|
|
|
entity.setFloatIconPath(form.getFloatIconPath()); |
|
|
|
baseDao.insert(entity); |
|
|
|
public void createFootBarCustomer(SyncFootBar4CustomerFormDTO form) { |
|
|
|
if (!CollectionUtils.isEmpty(form.getSyncBarKeyList())) { |
|
|
|
List<CustomerFootBarEntity> syncList = baseDao.selectListByKey(Constant.DEFAULT_CUSTOMER, form.getAppType(), form.getSyncBarKeyList()); |
|
|
|
syncList.forEach(syncEntity -> { |
|
|
|
baseDao.updateCustomerFootBarByKey(form.getCustomerId(), |
|
|
|
form.getAppType(), |
|
|
|
syncEntity.getBarKey(), |
|
|
|
form.getUserId(), |
|
|
|
syncEntity.getPageTitle(), |
|
|
|
syncEntity.getBarName(), |
|
|
|
syncEntity.getIconPath(), |
|
|
|
syncEntity.getSelectedIconPath(), |
|
|
|
syncEntity.getFloatIconPath() |
|
|
|
); |
|
|
|
}); |
|
|
|
} |
|
|
|
if (!CollectionUtils.isEmpty(form.getAddBarKeyList())) { |
|
|
|
List<CustomerFootBarEntity> addList = baseDao.selectListByKey(Constant.DEFAULT_CUSTOMER, form.getAppType(), form.getAddBarKeyList()); |
|
|
|
addList.forEach(addEntity -> { |
|
|
|
CustomerFootBarFormDTO footBarFormDTO = new CustomerFootBarFormDTO(); |
|
|
|
footBarFormDTO.setCustomerId(form.getCustomerId()); |
|
|
|
footBarFormDTO.setAppType(form.getAppType()); |
|
|
|
footBarFormDTO.setBarKey(addEntity.getBarKey()); |
|
|
|
footBarFormDTO.setBarName(addEntity.getBarName()); |
|
|
|
validateBeforeCreate(footBarFormDTO); |
|
|
|
|
|
|
|
CustomerFootBarEntity entity = ConvertUtils.sourceToTarget(addEntity, CustomerFootBarEntity.class); |
|
|
|
entity.setCustomerId(form.getCustomerId()); |
|
|
|
entity.setOrderIndex(baseDao.fetchNextOrder(form.getCustomerId(), form.getAppType())); |
|
|
|
entity.setDisplay(true); |
|
|
|
baseDao.insert(entity); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|