| | |
| | | package cn.ksource.web.service.knowledge; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import cn.ksource.beans.GG_USER; |
| | | import cn.ksource.beans.KM_LIBRARY; |
| | | import cn.ksource.beans.KM_RECORD; |
| | | import cn.ksource.core.dao.BaseDao; |
| | | import cn.ksource.core.util.ConvertUtil; |
| | | import cn.ksource.core.util.DateUtil; |
| | | import cn.ksource.core.util.StringUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | @Service |
| | | public class KmRecordServiceImpl implements KmRecordService { |
| | | |
| | | |
| | | @Autowired |
| | | private BaseDao baseDao; |
| | | |
| | | @Override |
| | | public void addrecord(Map<String, String> params) { |
| | | String id = params.get("library_id"); |
| | | |
| | | |
| | | String sql1 = "SELECT * FROM KM_SCORE_RULE ORDER BY SCORE "; |
| | | List<Map> list = baseDao.queryForList(sql1); |
| | | Map cacheMap = new HashMap(); |
| | | for(Map map:list){ |
| | | int score = ConvertUtil.obj2Int(map.get("SCORE")); |
| | | cacheMap.put(map.get("TYPE"),score); |
| | | cacheMap.put(ConvertUtil.obj2Integer(map.get("TYPE")),score); |
| | | } |
| | | KM_RECORD record = new KM_RECORD(); |
| | | record.setLibrary_id(id).setType(ConvertUtil.obj2Integer(params.get("type"))).setScore(ConvertUtil.obj2Integer(cacheMap.get(ConvertUtil.obj2Integer(params.get("type"))))) |