|
@ -18,24 +18,17 @@ |
|
|
package com.epmet.modules.group.service.impl; |
|
|
package com.epmet.modules.group.service.impl; |
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
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.mybatis.service.impl.BaseServiceImpl; |
|
|
import com.epmet.commons.tools.constant.FieldConstant; |
|
|
|
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
import com.epmet.commons.tools.page.PageData; |
|
|
|
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
import com.epmet.modules.group.dao.ResiGroupAchievementStatsDao; |
|
|
import com.epmet.modules.group.dao.ResiGroupAchievementStatsDao; |
|
|
import com.epmet.modules.group.entity.ResiGroupAchievementStatsEntity; |
|
|
import com.epmet.modules.group.entity.ResiGroupAchievementStatsEntity; |
|
|
import com.epmet.modules.group.service.ResiGroupAchievementStatsService; |
|
|
import com.epmet.modules.group.service.ResiGroupAchievementStatsService; |
|
|
import com.epmet.resi.group.dto.group.ResiGroupAchievementStatsDTO; |
|
|
import com.epmet.resi.group.dto.group.ResiGroupAchievementStatsDTO; |
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
|
import java.util.Arrays; |
|
|
|
|
|
import java.util.HashMap; |
|
|
|
|
|
import java.util.List; |
|
|
import java.util.List; |
|
|
import java.util.Map; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 小组成就统计表 |
|
|
* 小组成就统计表 |
|
@ -46,45 +39,6 @@ import java.util.Map; |
|
|
@Service |
|
|
@Service |
|
|
public class ResiGroupAchievementStatsServiceImpl extends BaseServiceImpl<ResiGroupAchievementStatsDao, ResiGroupAchievementStatsEntity> implements ResiGroupAchievementStatsService { |
|
|
public class ResiGroupAchievementStatsServiceImpl extends BaseServiceImpl<ResiGroupAchievementStatsDao, ResiGroupAchievementStatsEntity> implements ResiGroupAchievementStatsService { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
public PageData<ResiGroupAchievementStatsDTO> page(Map<String, Object> params) { |
|
|
|
|
|
IPage<ResiGroupAchievementStatsEntity> page = baseDao.selectPage( |
|
|
|
|
|
getPage(params, FieldConstant.CREATED_TIME, false), |
|
|
|
|
|
getWrapper(params) |
|
|
|
|
|
); |
|
|
|
|
|
return getPageData(page, ResiGroupAchievementStatsDTO.class); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
public List<ResiGroupAchievementStatsDTO> list(Map<String, Object> params) { |
|
|
|
|
|
List<ResiGroupAchievementStatsEntity> entityList = baseDao.selectList(getWrapper(params)); |
|
|
|
|
|
|
|
|
|
|
|
return ConvertUtils.sourceToTarget(entityList, ResiGroupAchievementStatsDTO.class); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private QueryWrapper<ResiGroupAchievementStatsEntity> getWrapper(Map<String, Object> params){ |
|
|
|
|
|
String id = (String)params.get(FieldConstant.ID_HUMP); |
|
|
|
|
|
|
|
|
|
|
|
QueryWrapper<ResiGroupAchievementStatsEntity> wrapper = new QueryWrapper<>(); |
|
|
|
|
|
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |
|
|
|
|
|
|
|
|
|
|
|
return wrapper; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
public ResiGroupAchievementStatsDTO get(String id) { |
|
|
|
|
|
ResiGroupAchievementStatsEntity entity = baseDao.selectById(id); |
|
|
|
|
|
return ConvertUtils.sourceToTarget(entity, ResiGroupAchievementStatsDTO.class); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
|
|
public void save(ResiGroupAchievementStatsDTO dto) { |
|
|
|
|
|
ResiGroupAchievementStatsEntity entity = ConvertUtils.sourceToTarget(dto, ResiGroupAchievementStatsEntity.class); |
|
|
|
|
|
insert(entity); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
public void update(ResiGroupAchievementStatsDTO dto) { |
|
|
public void update(ResiGroupAchievementStatsDTO dto) { |
|
@ -92,13 +46,6 @@ public class ResiGroupAchievementStatsServiceImpl extends BaseServiceImpl<ResiGr |
|
|
updateById(entity); |
|
|
updateById(entity); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
|
|
public void delete(String[] ids) { |
|
|
|
|
|
// 逻辑删除(@TableLogic 注解)
|
|
|
|
|
|
baseDao.deleteBatchIds(Arrays.asList(ids)); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 已达成的成就 |
|
|
* 已达成的成就 |
|
|
* |
|
|
* |
|
@ -125,7 +72,7 @@ public class ResiGroupAchievementStatsServiceImpl extends BaseServiceImpl<ResiGr |
|
|
* @param groupId |
|
|
* @param groupId |
|
|
* @return java.util.List<com.epmet.resi.group.dto.group.ResiGroupMilestoneStatsDTO> |
|
|
* @return java.util.List<com.epmet.resi.group.dto.group.ResiGroupMilestoneStatsDTO> |
|
|
* @author zhaoqifeng |
|
|
* @author zhaoqifeng |
|
|
* @date 2021/4/19 15:15 |
|
|
* @date 2021/4/19 15:15fang |
|
|
*/ |
|
|
*/ |
|
|
@Override |
|
|
@Override |
|
|
public List<ResiGroupAchievementStatsDTO> getUnAchieved(String groupId) { |
|
|
public List<ResiGroupAchievementStatsDTO> getUnAchieved(String groupId) { |
|
@ -142,11 +89,4 @@ public class ResiGroupAchievementStatsServiceImpl extends BaseServiceImpl<ResiGr |
|
|
return baseDao.saveOrUpdate(haveArrive, updateAll); |
|
|
return baseDao.saveOrUpdate(haveArrive, updateAll); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
public int deleteByCId(String customerId) { |
|
|
|
|
|
Map<String,Object> param = new HashMap<>(); |
|
|
|
|
|
param.put("CUSTOMER_ID",customerId); |
|
|
|
|
|
return baseDao.deleteByMap(param); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|