|
|
@ -21,16 +21,64 @@ import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|
|
|
import com.epmet.modules.act.dao.ActCategoryDictDao; |
|
|
|
import com.epmet.modules.act.entity.ActCategoryDictEntity; |
|
|
|
import com.epmet.modules.act.service.ActCategoryDictService; |
|
|
|
import com.epmet.modules.constant.GroupActConstant; |
|
|
|
import com.epmet.modules.member.service.ResiGroupMemberService; |
|
|
|
import com.epmet.resi.group.dto.act.form.ActCategoryFormDTO; |
|
|
|
import com.epmet.resi.group.dto.act.form.ActMenuFormDTO; |
|
|
|
import com.epmet.resi.group.dto.act.result.ActMenuResultDTO; |
|
|
|
import com.epmet.resi.group.dto.act.result.CategoryCodeResultDTO; |
|
|
|
import com.epmet.resi.group.dto.act.result.CategoryDTO; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.apache.commons.collections4.CollectionUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
/** |
|
|
|
* 活动类别字典 |
|
|
|
* |
|
|
|
* @author generator generator@elink-cn.com |
|
|
|
* @since v1.0.0 2021-04-16 |
|
|
|
*/ |
|
|
|
@Slf4j |
|
|
|
@Service |
|
|
|
public class ActCategoryDictServiceImpl extends BaseServiceImpl<ActCategoryDictDao, ActCategoryDictEntity> implements ActCategoryDictService { |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private ResiGroupMemberService resiGroupMemberService; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* 001、活动类别列表 |
|
|
|
* |
|
|
|
* @param formDTO |
|
|
|
* @return com.epmet.resi.group.dto.act.result.ActMenuResultDTO |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public ActMenuResultDTO queryMenuList(ActMenuFormDTO formDTO) { |
|
|
|
ActMenuResultDTO resultDTO = new ActMenuResultDTO(); |
|
|
|
resultDTO.setShouldAttend(resiGroupMemberService.selectCountMember(formDTO.getGroupId())); |
|
|
|
List<CategoryDTO> categoryList = baseDao.selectFirstLevelCategory(formDTO.getCustomerId()); |
|
|
|
if (CollectionUtils.isEmpty(categoryList)) { |
|
|
|
categoryList = baseDao.selectFirstLevelCategory(GroupActConstant.DEFAULT_CUSTOMER_ID); |
|
|
|
} |
|
|
|
resultDTO.setCategoryList(categoryList); |
|
|
|
return resultDTO; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 002、活动类别下拉框查询 |
|
|
|
* |
|
|
|
* @param formDTO |
|
|
|
* @return com.epmet.resi.group.dto.act.result.CategoryCodeResultDTO |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public List<CategoryCodeResultDTO> queryCategoryList(ActCategoryFormDTO formDTO) { |
|
|
|
List<CategoryCodeResultDTO> list = baseDao.selectCategoryList(formDTO.getCategoryCode(), formDTO.getCustomerId()); |
|
|
|
if (CollectionUtils.isEmpty(list)) { |
|
|
|
list = baseDao.selectCategoryList(formDTO.getCategoryCode(), GroupActConstant.DEFAULT_CUSTOMER_ID); |
|
|
|
} |
|
|
|
return list; |
|
|
|
} |
|
|
|
} |