Browse Source

yinruoxi:

修改:
1. bug修正
2. RedisConfig 变更
tags/v0.8.0a
kira 2 years ago
parent
commit
ba01afdf0d
7 changed files with 47 additions and 7 deletions
  1. +24
    -0
      xueyi-common/xueyi-common-redis/src/main/java/com/xueyi/common/redis/configure/RedisConfig.java
  2. +0
    -1
      xueyi-modules/xueyi-message/src/main/java/com/xueyi/message/transfer/controller/ApiController.java
  3. +11
    -0
      xueyi-modules/xueyi-system/src/main/java/com/xueyi/system/digitalmans/domain/vo/DmSyncDigitalmanVo.java
  4. +1
    -1
      xueyi-modules/xueyi-system/src/main/java/com/xueyi/system/digitalmans/manager/impl/DmDigitalmanManager.java
  5. +4
    -1
      xueyi-modules/xueyi-system/src/main/java/com/xueyi/system/digitalmans/mapper/DmSkillMapper.java
  6. +5
    -1
      xueyi-modules/xueyi-system/src/main/java/com/xueyi/system/digitalmans/service/impl/DmSkillServiceImpl.java
  7. +2
    -3
      xueyi-modules/xueyi-system/src/main/resources/mapper/digitalmans/DmSkillMapper.xml

+ 24
- 0
xueyi-common/xueyi-common-redis/src/main/java/com/xueyi/common/redis/configure/RedisConfig.java View File

@@ -7,9 +7,13 @@ import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer;
import org.springframework.data.redis.serializer.StringRedisSerializer;

import java.io.Serializable;

/**
* redis配置
*
@@ -39,4 +43,24 @@ public class RedisConfig extends CachingConfigurerSupport {
template.afterPropertiesSet();
return template;
}

@Bean

public RedisTemplate<String, Serializable> redisCacheTemplate(LettuceConnectionFactory redisConnectionFactory){

RedisTemplate<String,Serializable> template = new RedisTemplate<String,Serializable>();

template.setKeySerializer(new StringRedisSerializer());

template.setValueSerializer(new GenericJackson2JsonRedisSerializer());

template.setHashKeySerializer(new StringRedisSerializer());// Hash key序列化

template.setHashValueSerializer(new GenericJackson2JsonRedisSerializer());// Hash value序列化

template.setConnectionFactory(redisConnectionFactory);

return template;

}
}

+ 0
- 1
xueyi-modules/xueyi-message/src/main/java/com/xueyi/message/transfer/controller/ApiController.java View File

@@ -176,7 +176,6 @@ public class ApiController {
// 调用初始化处理(数字人,数字人设备,形象,技能)
remoteDigitalmanService.initInner(vo.getSecret(),deviceTenantSourceMergeVoR.getData().getTenantId(),deviceTenantSourceMergeVoR.getData().getSourceSlave(),SecurityConstants.INNER);
// 根据状态返回结果

return AjaxResult.success();
}



+ 11
- 0
xueyi-modules/xueyi-system/src/main/java/com/xueyi/system/digitalmans/domain/vo/DmSyncDigitalmanVo.java View File

@@ -0,0 +1,11 @@
package com.xueyi.system.digitalmans.domain.vo;

import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
public class DmSyncDigitalmanVo {
private Long manId;
private String timestamp;
}

+ 1
- 1
xueyi-modules/xueyi-system/src/main/java/com/xueyi/system/digitalmans/manager/impl/DmDigitalmanManager.java View File

@@ -113,7 +113,7 @@ public class DmDigitalmanManager extends BaseManagerImpl<DmDigitalmanQuery, DmDi
sdmdto.setNickName(dmpo.getNickName());
sdmdto.setUpdateTime(dmpo.getUpdateTime());
sdmdto.setWorktime(digitalmanWorktimeMapper.selectById(dmpo.getId()));
DmModelPo mpo = modelMapper.selectOne(Wrappers.<DmModelPo>query().lambda().eq(DmModelPo::getManId,manCode));
DmModelPo mpo = modelMapper.selectOne(Wrappers.<DmModelPo>query().lambda().eq(DmModelPo::getManId,dmpo.getId()));

sdmdto.setBackground(dmResourcesMapper.selectById(mpo.getCurrentBackground()));
sdmdto.setIcon(dmResourcesMapper.selectById(mpo.getIconId()));


+ 4
- 1
xueyi-modules/xueyi-system/src/main/java/com/xueyi/system/digitalmans/mapper/DmSkillMapper.java View File

@@ -4,9 +4,11 @@ package com.xueyi.system.digitalmans.mapper;

import com.xueyi.common.web.entity.mapper.BaseMapper;
import com.xueyi.common.datasource.annotation.Isolate;
import com.xueyi.message.api.transfer.domain.vo.DmActiveVo;
import com.xueyi.system.api.digitalmans.domain.dto.DmSkillDto;
import com.xueyi.system.api.digitalmans.domain.po.DmSkillPo;
import com.xueyi.system.digitalmans.domain.query.DmSkillQuery;
import com.xueyi.system.digitalmans.domain.vo.DmSyncDigitalmanVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;
@@ -19,5 +21,6 @@ import java.util.List;
@Isolate
public interface DmSkillMapper extends BaseMapper<DmSkillQuery, DmSkillDto, DmSkillPo> {

public List<DmSkillDto> selectSkillListByH5(@Param("manId")Long manId, @Param("timestamp") String timestamp);
//public List<DmSkillDto> selectSkillListByH5(@Param("manId")Long manId, @Param("timestamp") String timestamp);
public List<DmSkillDto> selectSkillListByH5(DmSyncDigitalmanVo vo);
}

+ 5
- 1
xueyi-modules/xueyi-system/src/main/java/com/xueyi/system/digitalmans/service/impl/DmSkillServiceImpl.java View File

@@ -7,6 +7,7 @@ import com.xueyi.system.digitalmans.domain.dto.DmCustomMadeDto;
import com.xueyi.system.digitalmans.domain.dto.DmDigitalmanDto;
import com.xueyi.system.digitalmans.domain.query.DmInitSkillQuery;
import com.xueyi.system.digitalmans.domain.query.DmSkillQuery;
import com.xueyi.system.digitalmans.domain.vo.DmSyncDigitalmanVo;
import com.xueyi.system.digitalmans.manager.IDmSkillManager;
import com.xueyi.system.digitalmans.manager.impl.DmInitSkillManager;
import com.xueyi.system.digitalmans.manager.impl.DmSkillManager;
@@ -51,7 +52,10 @@ public class DmSkillServiceImpl extends BaseServiceImpl<DmSkillQuery, DmSkillDto

@Override
public List<DmSkillDto> selectSkillListByTimestamp(Long manId, String timestamp) {
List<DmSkillDto> list = skillMapper.selectSkillListByH5(manId,timestamp);
DmSyncDigitalmanVo vo = new DmSyncDigitalmanVo();
vo.setTimestamp(timestamp);
vo.setManId(manId);
List<DmSkillDto> list = skillMapper.selectSkillListByH5(vo);
return list;
}



+ 2
- 3
xueyi-modules/xueyi-system/src/main/resources/mapper/digitalmans/DmSkillMapper.xml View File

@@ -19,9 +19,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"




<select id="selectSkillListByH5" parameterType="DmSkillPo" resultMap="DmSkillResult">
<select id="selectSkillListByH5" parameterType="DmSyncDigitalmanVo" resultMap="DmSkillResult">
select s.id, s.man_id,s.status, s.first_call, s.skill_code, s.info, s.del_flag, s.resp, s.motion_id, s.motion_name from dm_skills s
where UNIX_TIMESTAMP(s.update_time) * 1000 > #{timestamp} and man_id = #{manId}
where (UNIX_TIMESTAMP(s.update_time) * 1000 > #{timestamp} or UNIX_TIMESTAMP(s.create_time) * 1000 > #{timestamp} ) and man_id = #{manId}
</select>
</mapper>

Loading…
Cancel
Save