|
|
@ -20,15 +20,21 @@ 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.FieldConstant; |
|
|
|
import com.epmet.commons.tools.page.PageData; |
|
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
|
import com.epmet.commons.tools.constant.FieldConstant; |
|
|
|
import com.epmet.constant.ActCustomizedConstant; |
|
|
|
import com.epmet.dao.ActCustomizedDao; |
|
|
|
import com.epmet.dto.ActCustomizedDTO; |
|
|
|
import com.epmet.dto.form.work.ActCustomizedFormDTO; |
|
|
|
import com.epmet.dto.form.work.SaveActCustomizedFormDTO; |
|
|
|
import com.epmet.dto.result.work.ActCustomizedResultDTO; |
|
|
|
import com.epmet.entity.ActCustomizedEntity; |
|
|
|
import com.epmet.redis.ActCustomizedRedis; |
|
|
|
import com.epmet.service.ActCustomizedService; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.apache.logging.log4j.LogManager; |
|
|
|
import org.apache.logging.log4j.Logger; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
@ -45,7 +51,7 @@ import java.util.Map; |
|
|
|
*/ |
|
|
|
@Service |
|
|
|
public class ActCustomizedServiceImpl extends BaseServiceImpl<ActCustomizedDao, ActCustomizedEntity> implements ActCustomizedService { |
|
|
|
|
|
|
|
private Logger logger = LogManager.getLogger(ActCustomizedServiceImpl.class); |
|
|
|
@Autowired |
|
|
|
private ActCustomizedRedis actCustomizedRedis; |
|
|
|
|
|
|
@ -101,4 +107,55 @@ public class ActCustomizedServiceImpl extends BaseServiceImpl<ActCustomizedDao, |
|
|
|
baseDao.deleteBatchIds(Arrays.asList(ids)); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @return com.epmet.dto.result.work.ActCustomizedResultDTO |
|
|
|
* @param formDTO |
|
|
|
* @author yinzuomei |
|
|
|
* @description 获取当前客户下,爱心互助模块自定义配置项,如果没有配置,返回系统默认 |
|
|
|
* @Date 2020/7/20 17:27 |
|
|
|
**/ |
|
|
|
@Override |
|
|
|
public ActCustomizedResultDTO getConfigs(ActCustomizedFormDTO formDTO) { |
|
|
|
ActCustomizedResultDTO actCustomizedResultDTO = baseDao.selectConfigsByCustomerId(formDTO.getCustomerId()); |
|
|
|
if (null == actCustomizedResultDTO) { |
|
|
|
logger.info(String.format("客户id%s没有自定义爱心互助相关图标名称,初始化默认值插入数据库", formDTO.getCustomerId())); |
|
|
|
ActCustomizedEntity actCustomizedEntity = new ActCustomizedEntity(); |
|
|
|
actCustomizedEntity.setCustomerId(formDTO.getCustomerId()); |
|
|
|
actCustomizedEntity.setTitleName(ActCustomizedConstant.TITLE_NAME); |
|
|
|
actCustomizedEntity.setHotline(ActCustomizedConstant.HOT_LINE); |
|
|
|
actCustomizedEntity.setActListName(ActCustomizedConstant.ACT_LIST_NAME); |
|
|
|
actCustomizedEntity.setHeartRankName(ActCustomizedConstant.HEART_RANK_NAME); |
|
|
|
actCustomizedEntity.setActReviewName(ActCustomizedConstant.ACT_REVIEW_NAME); |
|
|
|
actCustomizedEntity.setMyActName(ActCustomizedConstant.MY_ACT_NAME); |
|
|
|
insert(actCustomizedEntity); |
|
|
|
actCustomizedResultDTO = ConvertUtils.sourceToTarget(actCustomizedEntity, ActCustomizedResultDTO.class); |
|
|
|
actCustomizedResultDTO.setActCustomizedId(actCustomizedEntity.getId()); |
|
|
|
} |
|
|
|
return actCustomizedResultDTO; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @return void |
|
|
|
* @param formDTO |
|
|
|
* @author yinzuomei |
|
|
|
* @description 保存自定义配置 |
|
|
|
* @Date 2020/7/20 17:27 |
|
|
|
**/ |
|
|
|
@Override |
|
|
|
public void saveConfigs(SaveActCustomizedFormDTO formDTO) { |
|
|
|
ActCustomizedDTO actCustomizedDTO=this.get(formDTO.getActCustomizedId()); |
|
|
|
if(null!=actCustomizedDTO){ |
|
|
|
actCustomizedDTO.setTitleName(formDTO.getTitleName()); |
|
|
|
actCustomizedDTO.setHotline(formDTO.getHotLine()); |
|
|
|
actCustomizedDTO.setActListName(formDTO.getActListName()); |
|
|
|
actCustomizedDTO.setHeartRankName(formDTO.getHeartRankName()); |
|
|
|
actCustomizedDTO.setActReviewName(formDTO.getActReviewName()); |
|
|
|
actCustomizedDTO.setMyActName(formDTO.getMyActName()); |
|
|
|
this.update(actCustomizedDTO); |
|
|
|
return; |
|
|
|
}else{ |
|
|
|
logger.error("根据主键",formDTO.getActCustomizedId(),"查询act_customized表为空,保存自定义配置失败"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |