|
|
@ -17,25 +17,18 @@ |
|
|
|
|
|
|
|
package com.epmet.service.stats.impl; |
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.epmet.commons.dynamic.datasource.annotation.DataSource; |
|
|
|
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.constant.DataSourceConstant; |
|
|
|
import com.epmet.dao.stats.FactIssueGridMonthlyDao; |
|
|
|
import com.epmet.dto.stats.FactIssueGridMonthlyDTO; |
|
|
|
import com.epmet.entity.stats.FactIssueGridMonthlyEntity; |
|
|
|
import com.epmet.service.stats.FactIssueGridMonthlyService; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
import java.util.Arrays; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
/** |
|
|
|
* 网格议题数量(按月) |
|
|
@ -47,51 +40,6 @@ import java.util.Map; |
|
|
|
@DataSource(DataSourceConstant.STATS) |
|
|
|
public class FactIssueGridMonthlyServiceImpl extends BaseServiceImpl<FactIssueGridMonthlyDao, FactIssueGridMonthlyEntity> implements FactIssueGridMonthlyService { |
|
|
|
|
|
|
|
@Override |
|
|
|
public PageData<FactIssueGridMonthlyDTO> page(Map<String, Object> params) { |
|
|
|
IPage<FactIssueGridMonthlyEntity> page = baseDao.selectPage( |
|
|
|
getPage(params, FieldConstant.CREATED_TIME, false), |
|
|
|
getWrapper(params) |
|
|
|
); |
|
|
|
return getPageData(page, FactIssueGridMonthlyDTO.class); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public List<FactIssueGridMonthlyDTO> list(Map<String, Object> params) { |
|
|
|
List<FactIssueGridMonthlyEntity> entityList = baseDao.selectList(getWrapper(params)); |
|
|
|
|
|
|
|
return ConvertUtils.sourceToTarget(entityList, FactIssueGridMonthlyDTO.class); |
|
|
|
} |
|
|
|
|
|
|
|
private QueryWrapper<FactIssueGridMonthlyEntity> getWrapper(Map<String, Object> params){ |
|
|
|
String id = (String)params.get(FieldConstant.ID_HUMP); |
|
|
|
|
|
|
|
QueryWrapper<FactIssueGridMonthlyEntity> wrapper = new QueryWrapper<>(); |
|
|
|
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |
|
|
|
|
|
|
|
return wrapper; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public FactIssueGridMonthlyDTO get(String id) { |
|
|
|
FactIssueGridMonthlyEntity entity = baseDao.selectById(id); |
|
|
|
return ConvertUtils.sourceToTarget(entity, FactIssueGridMonthlyDTO.class); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public void save(FactIssueGridMonthlyDTO dto) { |
|
|
|
FactIssueGridMonthlyEntity entity = ConvertUtils.sourceToTarget(dto, FactIssueGridMonthlyEntity.class); |
|
|
|
insert(entity); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public void update(FactIssueGridMonthlyDTO dto) { |
|
|
|
FactIssueGridMonthlyEntity entity = ConvertUtils.sourceToTarget(dto, FactIssueGridMonthlyEntity.class); |
|
|
|
updateById(entity); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public void delete(String[] ids) { |
|
|
@ -116,4 +64,18 @@ public class FactIssueGridMonthlyServiceImpl extends BaseServiceImpl<FactIssueGr |
|
|
|
insertBatch(list); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* desc: 获取该客户下某月的 议题数量 |
|
|
|
* |
|
|
|
* @param customerId |
|
|
|
* @param monthId |
|
|
|
* @return java.util.List<com.epmet.entity.stats.FactIssueGridMonthlyEntity> |
|
|
|
* @author LiuJanJun |
|
|
|
* @date 2020/9/25 5:00 下午 |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public List<FactIssueGridMonthlyEntity> getIssueCount(String customerId, String monthId) { |
|
|
|
return null; |
|
|
|
} |
|
|
|
|
|
|
|
} |