forked from rongchao/epmet-cloud-rizhao
9 changed files with 247 additions and 85 deletions
@ -0,0 +1,41 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.service.evaluationindex.indexcoll; |
|||
|
|||
|
|||
import com.epmet.commons.mybatis.service.BaseService; |
|||
import com.epmet.entity.evaluationindex.indexcoll.FactIndexServiceAblityGridMonthlyEntity; |
|||
|
|||
|
|||
/** |
|||
* 服务能力-网格相关事实表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2020-09-21 |
|||
*/ |
|||
public interface FactIndexServiceAblityGridMonthlyService extends BaseService<FactIndexServiceAblityGridMonthlyEntity> { |
|||
/** |
|||
* @return void |
|||
* @param customerId |
|||
* @param monthId |
|||
* @author yinzuomei |
|||
* @description 批量删除网格相关-服务能力指标表 |
|||
* @Date 2020/9/21 16:38 |
|||
**/ |
|||
void deleteBatchIndexServiceAblityGridMonthly(String customerId, String monthId); |
|||
} |
|||
@ -0,0 +1,54 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.service.evaluationindex.indexcoll.impl; |
|||
|
|||
import com.epmet.commons.dynamic.datasource.annotation.DataSource; |
|||
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|||
import com.epmet.commons.tools.constant.NumConstant; |
|||
import com.epmet.constant.DataSourceConstant; |
|||
import com.epmet.dao.evaluationindex.indexcoll.FactIndexServiceAblityGridMonthlyDao; |
|||
import com.epmet.entity.evaluationindex.indexcoll.FactIndexServiceAblityGridMonthlyEntity; |
|||
import com.epmet.service.evaluationindex.indexcoll.FactIndexServiceAblityGridMonthlyService; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
/** |
|||
* 服务能力-网格相关事实表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2020-09-21 |
|||
*/ |
|||
@Service |
|||
public class FactIndexServiceAblityGridMonthlyServiceImpl extends BaseServiceImpl<FactIndexServiceAblityGridMonthlyDao, FactIndexServiceAblityGridMonthlyEntity> implements FactIndexServiceAblityGridMonthlyService { |
|||
|
|||
/** |
|||
* @return void |
|||
* @param customerId |
|||
* @param monthId |
|||
* @author yinzuomei |
|||
* @description 批量删除网格相关-服务能力指标表 |
|||
* @Date 2020/9/21 10:16 |
|||
**/ |
|||
@Override |
|||
@DataSource(DataSourceConstant.EVALUATION_INDEX) |
|||
public void deleteBatchIndexServiceAblityGridMonthly(String customerId, String monthId) { |
|||
int deleteNum; |
|||
do { |
|||
deleteNum = baseDao.deleteFactIndexServiceAblityGridMonthly(customerId, monthId); |
|||
} while (deleteNum > NumConstant.ZERO); |
|||
} |
|||
} |
|||
@ -0,0 +1,31 @@ |
|||
package com.epmet.service.heart; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 活动信息 |
|||
* |
|||
* @author yinzuomei@elink-cn.com |
|||
* @date 2020/9/21 16:39 |
|||
*/ |
|||
public interface ActInfoService { |
|||
/** |
|||
* @return java.util.List<java.lang.String> |
|||
* @param regUserIds |
|||
* @author yinzuomei |
|||
* @description 根据userId,查询用户是否是志愿者,返回是志愿者的用户集合 |
|||
* @Date 2020/9/21 16:41 |
|||
**/ |
|||
List<String> getGridRegUserVolunteer(List<String> regUserIds); |
|||
|
|||
/** |
|||
* @return java.util.Map<java.lang.String,java.lang.Integer> |
|||
* @param customerId |
|||
* @param monthId |
|||
* @author yinzuomei |
|||
* @description 网格活动组织次数 爱心活动 值得是: 活动状态已结束并且实际结束时间在评价周期内的 |
|||
* @Date 2020/9/21 16:43 |
|||
**/ |
|||
Map<String, Integer> calActivityCountMap(String customerId, String monthId); |
|||
} |
|||
@ -0,0 +1,61 @@ |
|||
package com.epmet.service.heart.impl; |
|||
|
|||
import com.epmet.commons.dynamic.datasource.annotation.DataSource; |
|||
import com.epmet.constant.DataSourceConstant; |
|||
import com.epmet.dao.heart.ActInfoDao; |
|||
import com.epmet.service.heart.ActInfoService; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.HashMap; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 活动信息 |
|||
* |
|||
* @author yinzuomei@elink-cn.com |
|||
* @date 2020/9/21 16:40 |
|||
*/ |
|||
@Slf4j |
|||
@Service |
|||
@DataSource(DataSourceConstant.EPMET_HEART) |
|||
public class ActInfoServiceImpl implements ActInfoService { |
|||
@Autowired |
|||
private ActInfoDao baseDao; |
|||
|
|||
/** |
|||
* @return java.util.List<java.lang.String> |
|||
* @param regUserIds |
|||
* @author yinzuomei |
|||
* @description 根据userId,查询用户是否是志愿者,返回是志愿者的用户集合 |
|||
* @Date 2020/9/21 13:50 |
|||
**/ |
|||
@Override |
|||
@DataSource(DataSourceConstant.EPMET_HEART) |
|||
public List<String> getGridRegUserVolunteer(List<String> regUserIds) { |
|||
return baseDao.selectGridRegUserVolunteer(regUserIds); |
|||
} |
|||
|
|||
/** |
|||
* @return java.util.Map<java.lang.String,java.lang.Integer> |
|||
* @param customerId |
|||
* @param monthId |
|||
* @author yinzuomei |
|||
* @description 网格活动组织次数 爱心活动 值得是: 活动状态已结束并且实际结束时间在评价周期内的 |
|||
* @Date 2020/9/21 10:23 |
|||
**/ |
|||
@Override |
|||
@DataSource(DataSourceConstant.EPMET_HEART) |
|||
public Map<String, Integer> calActivityCountMap(String customerId, String monthId) { |
|||
List<Map<String, Integer>> mapList = baseDao.selectActGroupByGridId(customerId, monthId); |
|||
Map<String, Integer> resultMap = new HashMap<>(); |
|||
for (Map<String, Integer> map : mapList) { |
|||
for (Map.Entry<String, Integer> m : map.entrySet()) { |
|||
resultMap.put(m.getKey(), m.getValue()); |
|||
} |
|||
} |
|||
return resultMap; |
|||
} |
|||
} |
|||
Loading…
Reference in new issue