Browse Source

添加节点类型、标签等

master
陈裕财 4 years ago
parent
commit
0951ea7b59
  1. 25
      xm-core/src/main/java/com/xm/core/ctrl/XmProjectGroupController.java
  2. 24
      xm-core/src/main/java/com/xm/core/service/cache/XmProjectCacheService.java
  3. 24
      xm-core/src/main/java/com/xm/core/service/cache/XmProjectGroupCacheService.java
  4. 19
      xm-core/src/main/java/com/xm/core/service/cache/XmTaskCacheService.java

25
xm-core/src/main/java/com/xm/core/ctrl/XmProjectGroupController.java

@ -70,7 +70,7 @@ public class XmProjectGroupController {
@ApiResponse(code = 200,response= XmProjectGroup.class,message = "{tips:{isOk:true/false,msg:'成功/失败原因',tipscode:'失败时错误码'},data:数据对象}")
})
@HasQx(value = "xm_core_xmProjectGroup_updateGroup",name = "批量更新修改项目团队信息",categoryId = "admin-xm",categoryName = "管理端-项目管理系统")
@RequestMapping(value="/updateGroup",method=RequestMethod.POST)
@RequestMapping(value="/edit",method=RequestMethod.POST)
public Map<String,Object> updateGroup(@RequestBody XmProjectGroup group) {
Tips tips=new Tips("小组更新成功");
@ -314,29 +314,6 @@ public class XmProjectGroupController {
return m;
}
/**
@ApiOperation( value = "根据主键修改一条xm_project_group信息",notes="editXmProjectGroup")
@ApiResponses({
@ApiResponse(code = 200,response=XmProjectGroup.class, message = "{tips:{isOk:true/false,msg:'成功/失败原因',tipscode:'失败时错误码'},data:数据对象}")
})
@RequestMapping(value="/edit",method=RequestMethod.POST)
public Map<String,Object> editXmProjectGroup(@RequestBody XmProjectGroup xmProjectGroup) {
Map<String,Object> m = new HashMap<>();
Tips tips=new Tips("成功更新一条数据");
try{
xmProjectGroupService.updateByPk(xmProjectGroup);
m.put("data",xmProjectGroup);
}catch (BizException e) {
tips=e.getTips();
logger.error("",e);
}catch (Exception e) {
tips.setFailureMsg(e.getMessage());
logger.error("",e);
}
m.put("tips", tips);
return m;
}
*/

24
xm-core/src/main/java/com/xm/core/service/cache/XmProjectCacheService.java

@ -5,6 +5,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import java.util.Calendar;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
@ -14,33 +15,42 @@ public class XmProjectCacheService {
@Autowired
RedisTemplate redisTemplate;
String currDateKey="";
public String getKey(){
Calendar currCal=Calendar.getInstance();
String dateKey=currCal.get(Calendar.YEAR)+"-"+currCal.get(Calendar.DAY_OF_YEAR);
if(dateKey.equals(currDateKey)){
return this.getCacheKey()+":"+dateKey;
}else {
currDateKey=dateKey;
this.redisTemplate.expire(this.getCacheKey()+":"+dateKey,24,TimeUnit.HOURS);
return this.getCacheKey()+":"+dateKey;
}
}
String getCacheKey() {
return "xm_project";
}
public void putProject(String projectId,XmProject Project){
String key=this.getCacheKey()+"_"+projectId;
String key=this.getKey()+"_"+projectId;
String hashKey=key;
redisTemplate.opsForHash().put(key, hashKey, Project);
redisTemplate.expire(hashKey, 24, TimeUnit.HOURS);
}
public XmProject getProject(String projectId){
String key=this.getCacheKey()+"_"+projectId;
String key=this.getKey()+"_"+projectId;
String hashKey=key;
return (XmProject) redisTemplate.opsForHash().get(key, hashKey);
}
public void putPortalProjectStates(List<Map<String,Object>> projects){
String key=this.getCacheKey()+"_"+"portal";
String key=this.getKey()+"_"+"portal";
String hashKey=key;
redisTemplate.opsForHash().put(key, hashKey, projects);
redisTemplate.expire(hashKey, 24, TimeUnit.HOURS);
}
public List<Map<String,Object>> getPortalProjectStates(){
String key=this.getCacheKey()+"_"+"portal";
String key=this.getKey()+"_"+"portal";
String hashKey=key;
return (List<Map<String,Object>>) redisTemplate.opsForHash().get(key, hashKey);

24
xm-core/src/main/java/com/xm/core/service/cache/XmProjectGroupCacheService.java

@ -5,6 +5,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import java.util.Calendar;
import java.util.List;
import java.util.concurrent.TimeUnit;
@ -14,33 +15,44 @@ public class XmProjectGroupCacheService {
@Autowired
RedisTemplate redisTemplate;
String currDateKey="";
public String getKey(){
Calendar currCal=Calendar.getInstance();
String dateKey=currCal.get(Calendar.YEAR)+"-"+currCal.get(Calendar.DAY_OF_YEAR);
if(dateKey.equals(currDateKey)){
return this.getCacheKey()+":"+dateKey;
}else {
currDateKey=dateKey;
this.redisTemplate.expire(this.getCacheKey()+":"+dateKey,24,TimeUnit.HOURS);
return this.getCacheKey()+":"+dateKey;
}
}
String getCacheKey() {
return "xm_project_group";
}
public void putProjectGroups(String projectId,List<XmProjectGroupVo> groups){
String key=this.getCacheKey()+"_prj_"+projectId;
String key=this.getKey()+"_prj_"+projectId;
String hashKey=key;
redisTemplate.opsForHash().put(key, hashKey, groups);
redisTemplate.expire(hashKey, 24, TimeUnit.HOURS);
}
public List<XmProjectGroupVo> getProjectGroups(String projectId){
String key=this.getCacheKey()+"_"+projectId;
String key=this.getKey()+"_"+projectId;
String hashKey=key;
return (List<XmProjectGroupVo>) redisTemplate.opsForHash().get(key, hashKey);
}
public List<XmProjectGroupVo> getProductGroups(String productId){
String key=this.getCacheKey()+"_pro_"+productId;
String key=this.getKey()+"_pro_"+productId;
String hashKey=key;
return (List<XmProjectGroupVo>) redisTemplate.opsForHash().get(key, hashKey);
}
public void putProductGroups(String productId,List<XmProjectGroupVo> groups){
String key=this.getCacheKey()+"_pro_"+productId;
String key=this.getKey()+"_pro_"+productId;
String hashKey=key;
redisTemplate.opsForHash().put(key, hashKey, groups);
redisTemplate.expire(hashKey, 24, TimeUnit.HOURS);
}
}

19
xm-core/src/main/java/com/xm/core/service/cache/XmTaskCacheService.java

@ -6,6 +6,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import java.util.Calendar;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
@ -16,18 +17,30 @@ public class XmTaskCacheService {
@Autowired
RedisTemplate redisTemplate;
String currDateKey="";
public String getKey(){
Calendar currCal=Calendar.getInstance();
String dateKey=currCal.get(Calendar.YEAR)+"-"+currCal.get(Calendar.DAY_OF_YEAR);
if(dateKey.equals(currDateKey)){
return this.getCacheKey()+":"+dateKey;
}else {
currDateKey=dateKey;
this.redisTemplate.expire(this.getCacheKey()+":"+dateKey,24,TimeUnit.HOURS);
return this.getCacheKey()+":"+dateKey;
}
}
String getCacheKey() {
return "xm_task";
}
public void putTasks(String queryKeys, PageSerializable<Map<String,Object>> tasks){
String key=this.getCacheKey()+"_"+queryKeys;
String key=this.getKey()+"_"+queryKeys;
String hashKey=key;
redisTemplate.opsForHash().put(key, hashKey, tasks);
redisTemplate.expire(hashKey, 24, TimeUnit.HOURS);
}
public PageSerializable<Map<String,Object>> getTasks(String queryKeys){
String key=this.getCacheKey()+"_"+queryKeys;
String key=this.getKey()+"_"+queryKeys;
String hashKey=key;
return (PageSerializable<Map<String,Object>>) redisTemplate.opsForHash().get(key, hashKey);

Loading…
Cancel
Save