Commit 0712cf88 by huluobin

mapper 修改

parent a1ad716a
......@@ -61,6 +61,12 @@
<artifactId>mysql-connector-java</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-pool2</artifactId>
<version>2.6.2</version>
</dependency>
<!--2.0版本分页插件-->
<dependency>
<groupId>com.github.pagehelper</groupId>
......
......@@ -531,6 +531,8 @@ public class OrderManageServiceImpl extends ServiceImpl<OrderManageMapper, Order
return map;
}
private final ScheduleServeMapper scheduleServeMapper;
@Override
public List<OrderServe> addOrModifyOrderComment(CreateCommentCommand cmd) {
OrderManage orderManage = orderManageMapper.selectById(cmd.getOrderId());
......@@ -540,8 +542,26 @@ public class OrderManageServiceImpl extends ServiceImpl<OrderManageMapper, Order
}
List<OrderServe> orderServeList = orderServeMapper.selectList(new LambdaQueryWrapper<OrderServe>().eq(OrderServe::getOrderId, orderManage.getId()));
List<Integer> orderServeIds = orderServeList.stream().map(OrderServe::getId).collect(Collectors.toList());
// List<Integer> commentOrderServeIds
ScheduleManage scheduleManage = scheduleManageMapper.selectById(orderManage.getScheduledId());
List<ScheduleServe> scheduleServeList = scheduleServeMapper.selectList(new LambdaQueryWrapper<ScheduleServe>()
.eq(ScheduleServe::getSchId, scheduleManage.getId())
.eq(ScheduleServe::getMainServeId, null));
//主服务id
List<Integer> scheduledServeServeIds = scheduleServeList.stream().map(ScheduleServe::getServeId).collect(Collectors.toList());
//待评论的主服务ID
List<Integer> orderServeIds = orderServeList.stream()
.filter(orderServe -> scheduledServeServeIds.contains(orderServe.getServeId()))
.map(OrderServe::getId)
.collect(Collectors.toList());
//发表评论的服务id
List<Integer> commandOrderServeIds = cmd.getCommentList().stream().map(OrderCommentCommand::getOrderServeId).collect(Collectors.toList());
//参数检查
//保存所有订单评论给
List<OrderCommentCommand> orderCommentCommandList = cmd.getCommentList();
orderCommentCommandList
......
......@@ -3,6 +3,8 @@ package com.gogirl.application.product.serve;
import com.gogirl.domain.product.serve.ColorSystem;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
/**
* <p>
* 色系 服务类
......@@ -13,4 +15,5 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/
public interface IColorSystemService extends IService<ColorSystem> {
List<ColorSystem> query(Integer id);
}
package com.gogirl.application.product.serve;
import com.gogirl.domain.product.serve.ColorSystemType;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 服务类
* </p>
*
* @author robbendev
* @since 2020-03-11
*/
public interface IColorSystemTypeService extends IService<ColorSystemType> {
}
package com.gogirl.application.product.serve.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gogirl.application.product.serve.IColorSystemService;
import com.gogirl.domain.product.serve.ColorSystem;
import com.gogirl.infrastructure.mapper.product.serve.ColorSystemMapper;
import com.gogirl.application.product.serve.IColorSystemService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* <p>
* 色系 服务实现类
......@@ -17,4 +20,9 @@ import org.springframework.stereotype.Service;
@Service
public class ColorSystemServiceImpl extends ServiceImpl<ColorSystemMapper, ColorSystem> implements IColorSystemService {
@Override
public List<ColorSystem> query(Integer id) {
return this.list(new LambdaQueryWrapper<ColorSystem>().eq(ColorSystem::getPid, id));
}
}
package com.gogirl.application.product.serve.impl;
import com.gogirl.domain.product.serve.ColorSystemType;
import com.gogirl.infrastructure.mapper.product.serve.ColorSystemTypeMapper;
import com.gogirl.application.product.serve.IColorSystemTypeService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* <p>
* 服务实现类
* </p>
*
* @author robbendev
* @since 2020-03-11
*/
@Service
public class ColorSystemTypeServiceImpl extends ServiceImpl<ColorSystemTypeMapper, ColorSystemType> implements IColorSystemTypeService {
}
......@@ -98,6 +98,7 @@ public class StoreTechnicianServiceImpl extends ServiceImpl<StoreTechnicianMappe
Integer technicianId = SessionUtils.getTechnicianId();
StoreTechnician storeTechnician = this.getById(technicianId);
GogirlToken gogirlToken = SessionUtils.getTechnicianToken();
storeTechnician.setTechnicianId(storeTechnician.getId());
storeTechnician.setDepartmentId(gogirlToken.getDepartmentId());
storeTechnician.setDepartmentName(gogirlToken.getDepartmentName());
return storeTechnician;
......
package com.gogirl.domain.product;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* <p>
*
* </p>
*
* @author robbendev
* @since 2020-03-11
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="ColorSystemType对象", description="")
public class ColorSystemType implements Serializable {
private static final long serialVersionUID = 1L;
private String name;
}
package com.gogirl.domain.product.serve;
import java.io.Serializable;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serializable;
/**
* <p>
* 色系
......@@ -18,12 +20,17 @@ import lombok.experimental.Accessors;
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="ColorSystem对象", description="色系")
@ApiModel(value = "ColorSystem对象", description = "色系")
public class ColorSystem implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(type = IdType.AUTO)
private Integer id;
private String name;
private String images;
private String selectedImages;
private Integer pid;
}
package com.gogirl.domain.product.serve;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* <p>
*
* </p>
*
* @author robbendev
* @since 2020-03-11
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="ColorSystemType对象", description="")
public class ColorSystemType implements Serializable {
private static final long serialVersionUID = 1L;
private String name;
}
//package com.gogirl.infrastructure.config;
//
//import com.fasterxml.jackson.annotation.JsonAutoDetect;
//import com.fasterxml.jackson.annotation.PropertyAccessor;
//import com.fasterxml.jackson.databind.ObjectMapper;
//import org.springframework.cache.CacheManager;
//import org.springframework.cache.annotation.CachingConfigurerSupport;
//import org.springframework.cache.interceptor.KeyGenerator;
//import org.springframework.context.annotation.Bean;
//import org.springframework.data.redis.cache.RedisCacheConfiguration;
//import org.springframework.data.redis.cache.RedisCacheManager;
//import org.springframework.data.redis.cache.RedisCacheWriter;
//import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory;
//import org.springframework.data.redis.core.RedisTemplate;
//import org.springframework.data.redis.core.StringRedisTemplate;
//import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;
//
//import java.lang.reflect.Method;
//
//public class CacheConfig extends CachingConfigurerSupport {
//
// /**
// * 自定义缓存key的生成策略。默认的生成策略是看不懂的(乱码内容) 通过Spring 的依赖注入特性进行自定义的配置注入并且此类是一个配置类可以更多程度的自定义配置
// *
// * @return
// */
// @Bean
// @Override
// public KeyGenerator keyGenerator() {
// return new KeyGenerator() {
// @Override
// public Object generate(Object target, Method method, Object... params) {
// StringBuilder sb = new StringBuilder();
// sb.append(target.getClass().getName());
// sb.append(method.getName());
// for (Object obj : params) {
// sb.append(obj.toString());
// }
// return sb.toString();
// }
// };
// }
//
// /**
// * 缓存配置管理器
// */
// @Bean
// public CacheManager cacheManager(LettuceConnectionFactory factory) {
// //以锁写入的方式创建RedisCacheWriter对象
// RedisCacheWriter writer = RedisCacheWriter.lockingRedisCacheWriter(factory);
// /*
// 设置CacheManager的Value序列化方式为JdkSerializationRedisSerializer,
// 但其实RedisCacheConfiguration默认就是使用
// StringRedisSerializer序列化key,
// JdkSerializationRedisSerializer序列化value,
// 所以以下注释代码就是默认实现,没必要写,直接注释掉
// */
// // RedisSerializationContext.SerializationPair pair = RedisSerializationContext.SerializationPair.fromSerializer(new JdkSerializationRedisSerializer(this.getClass().getClassLoader()));
// // RedisCacheConfiguration config = RedisCacheConfiguration.defaultCacheConfig().serializeValuesWith(pair);
// //创建默认缓存配置对象
// RedisCacheConfiguration config = RedisCacheConfiguration.defaultCacheConfig();
// RedisCacheManager cacheManager = new RedisCacheManager(writer, config);
// return cacheManager;
// }
//
// /**
// * 获取缓存操作助手对象
// *
// * @return
// */
// @Bean
// public RedisTemplate<String, String> redisTemplate(LettuceConnectionFactory factory) {
// //创建Redis缓存操作助手RedisTemplate对象
// StringRedisTemplate template = new StringRedisTemplate();
// template.setConnectionFactory(factory);
// //以下代码为将RedisTemplate的Value序列化方式由JdkSerializationRedisSerializer更换为Jackson2JsonRedisSerializer
// //此种序列化方式结果清晰、容易阅读、存储字节少、速度快,所以推荐更换
// Jackson2JsonRedisSerializer jackson2JsonRedisSerializer = new Jackson2JsonRedisSerializer(Object.class);
// ObjectMapper om = new ObjectMapper();
// om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY);
// om.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL);
// jackson2JsonRedisSerializer.setObjectMapper(om);
// template.setValueSerializer(jackson2JsonRedisSerializer);
// template.afterPropertiesSet();
// //StringRedisTemplate是RedisTempLate<String, String>的子类
// return template;
// }
//}
\ No newline at end of file
package com.gogirl.infrastructure.mapper.product.serve;
import com.gogirl.domain.product.serve.ColorSystemType;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
* Mapper 接口
* </p>
*
* @author robbendev
* @since 2020-03-11
*/
public interface ColorSystemTypeMapper extends BaseMapper<ColorSystemType> {
}
package com.gogirl.interfaces.product.serve;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.gogirl.application.product.serve.IColorSystemService;
import com.gogirl.application.product.serve.IColorSystemTypeService;
import com.gogirl.domain.product.serve.ColorSystem;
import com.gogirl.infrastructure.common.base.JsonResult;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
......@@ -24,11 +27,12 @@ import java.util.List;
public class ColorSystemController {
private final IColorSystemService colorSystemService;
private final IColorSystemTypeService colorSystemTypeService;
@ApiOperation("查询所有款式色系")
@GetMapping("/customer/colorSystem/no_query")
public JsonResult<List<ColorSystem>> query() {
List<ColorSystem> list = colorSystemService.list();
@ApiOperation("款式色系")
@GetMapping("/customer/colorSystem/no_query/{id}")
public JsonResult<List<ColorSystem>> query(@PathVariable Integer id) {
List<ColorSystem> list = colorSystemService.query(id);
return JsonResult.success(list);
}
......
......@@ -111,6 +111,7 @@ public class XcxController {
public JsonResult<StoreTechnician> getTechnician(@RequestHeader String token) {
log.info("根据token:" + token + ",查询用户信息.");
StoreTechnician storeTechnician = storeTechnicianService.getTechnician();
return JsonResult.success(storeTechnician);
}
......
......@@ -36,6 +36,13 @@ spring:
host: 127.0.0.1
port: 6379
database: 0
lettuce:
pool:
max-active: 100
max-wait: 10000
max-idle: 100
min-idle: 10
timeout: 10000
#项目属性
gogirl:
......
......@@ -36,12 +36,12 @@ spring:
port: 6379
database: 0
timeout: 10000
# lettuce:
# pool:
# max-active: 100
# max-wait: 10000
# max-idle: 100
# min-idle: 10
lettuce:
pool:
max-active: 100
max-wait: 10000
max-idle: 100
min-idle: 10
#项目属性
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.gogirl.infrastructure.mapper.product.serve.ColorSystemTypeMapper">
</mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment