|
|
@ -17,23 +17,15 @@ |
|
|
|
|
|
|
|
package com.epmet.service.indexcal.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.page.PageData; |
|
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
|
import com.epmet.commons.tools.constant.FieldConstant; |
|
|
|
import com.epmet.dao.indexscore.DeptScoreDao; |
|
|
|
import com.epmet.dto.indexcal.DeptScoreDTO; |
|
|
|
import com.epmet.entity.indexcoll.DeptScoreEntity; |
|
|
|
import com.epmet.dao.indexcal.DeptScoreDao; |
|
|
|
import com.epmet.dao.indexcoll.FactIndexGovrnAblityDeptMonthlyDao; |
|
|
|
import com.epmet.dto.indexcal.CalculateCommonFormDTO; |
|
|
|
import com.epmet.entity.indexcal.DeptScoreEntity; |
|
|
|
import com.epmet.service.indexcal.DeptScoreService; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
import java.util.Arrays; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
/** |
|
|
|
* 区直部门分值表 |
|
|
@ -44,56 +36,25 @@ import java.util.Map; |
|
|
|
@Service |
|
|
|
public class DeptScoreServiceImpl extends BaseServiceImpl<DeptScoreDao, DeptScoreEntity> implements DeptScoreService { |
|
|
|
|
|
|
|
@Override |
|
|
|
public PageData<DeptScoreDTO> page(Map<String, Object> params) { |
|
|
|
IPage<DeptScoreEntity> page = baseDao.selectPage( |
|
|
|
getPage(params, FieldConstant.CREATED_TIME, false), |
|
|
|
getWrapper(params) |
|
|
|
); |
|
|
|
return getPageData(page, DeptScoreDTO.class); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public List<DeptScoreDTO> list(Map<String, Object> params) { |
|
|
|
List<DeptScoreEntity> entityList = baseDao.selectList(getWrapper(params)); |
|
|
|
|
|
|
|
return ConvertUtils.sourceToTarget(entityList, DeptScoreDTO.class); |
|
|
|
} |
|
|
|
|
|
|
|
private QueryWrapper<DeptScoreEntity> getWrapper(Map<String, Object> params){ |
|
|
|
String id = (String)params.get(FieldConstant.ID_HUMP); |
|
|
|
|
|
|
|
QueryWrapper<DeptScoreEntity> wrapper = new QueryWrapper<>(); |
|
|
|
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |
|
|
|
|
|
|
|
return wrapper; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public DeptScoreDTO get(String id) { |
|
|
|
DeptScoreEntity entity = baseDao.selectById(id); |
|
|
|
return ConvertUtils.sourceToTarget(entity, DeptScoreDTO.class); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public void save(DeptScoreDTO dto) { |
|
|
|
DeptScoreEntity entity = ConvertUtils.sourceToTarget(dto, DeptScoreEntity.class); |
|
|
|
insert(entity); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public void update(DeptScoreDTO dto) { |
|
|
|
DeptScoreEntity entity = ConvertUtils.sourceToTarget(dto, DeptScoreEntity.class); |
|
|
|
updateById(entity); |
|
|
|
} |
|
|
|
@Autowired |
|
|
|
private FactIndexGovrnAblityDeptMonthlyDao factIndexGovrnAblityDeptMonthlyDao; |
|
|
|
|
|
|
|
/** |
|
|
|
* @param formDTO |
|
|
|
* @return java.lang.Boolean |
|
|
|
* @author yinzuomei |
|
|
|
* @description 区直部门,分值计算 |
|
|
|
* @Date 2020/8/26 10:51 |
|
|
|
**/ |
|
|
|
@Override |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public void delete(String[] ids) { |
|
|
|
// 逻辑删除(@TableLogic 注解)
|
|
|
|
baseDao.deleteBatchIds(Arrays.asList(ids)); |
|
|
|
public Boolean calculateDeptCorreLation(CalculateCommonFormDTO formDTO) { |
|
|
|
//获取指标权重
|
|
|
|
/*List<IndexGroupDetailEntity> parentIndexDetails = getDetailListByParentCode.getDetailListByParentCode(formDTO.getCustomerId(), IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode()); |
|
|
|
if (CollectionUtils.isEmpty(parentIndexDetails)) { |
|
|
|
log.warn("cpcIndexCalculate customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); |
|
|
|
throw new RenException("客户【党员相关】指标权重信息不存在"); |
|
|
|
}*/ |
|
|
|
return null; |
|
|
|
} |
|
|
|
|
|
|
|
} |