日志记录

This commit is contained in:
2024-04-29 09:59:48 +08:00
parent ecae487993
commit 5ac93618a6
120 changed files with 1180 additions and 738 deletions

View File

@@ -72,29 +72,29 @@ public class RedisConfig extends CachingConfigurerSupport {
lettuceConnectionFactory.setDatabase(redisProperties.getDatabase());
return lettuceConnectionFactory;
}
@Bean
public RedisConnectionFactory redisConnectionFactory5() {
LettuceConnectionFactory lettuceConnectionFactory = new LettuceConnectionFactory(redisProperties.getHost(), redisProperties.getPort());
lettuceConnectionFactory.setPassword(redisProperties.getPassword());
lettuceConnectionFactory.setDatabase(5);
return lettuceConnectionFactory;
}
// @Bean
// public RedisConnectionFactory redisConnectionFactory5() {
// LettuceConnectionFactory lettuceConnectionFactory = new LettuceConnectionFactory(redisProperties.getHost(), redisProperties.getPort());
// lettuceConnectionFactory.setPassword(redisProperties.getPassword());
// lettuceConnectionFactory.setDatabase(5);
// return lettuceConnectionFactory;
// }
@Bean(name = "redis5Template")
public RedisTemplate<Object, Object> redis5Template(@Qualifier("redisConnectionFactory5") RedisConnectionFactory redisConnectionFactory5) {
RedisTemplate<Object, Object> template = new RedisTemplate<>();
//序列化
FastJsonRedisSerializer<Object> fastJsonRedisSerializer = new FastJsonRedisSerializer<>(Object.class);
// value值的序列化采用fastJsonRedisSerializer
template.setValueSerializer(fastJsonRedisSerializer);
template.setHashValueSerializer(fastJsonRedisSerializer);
// key的序列化采用StringRedisSerializer
template.setKeySerializer(new StringRedisSerializer());
template.setHashKeySerializer(new StringRedisSerializer());
template.setConnectionFactory(redisConnectionFactory5);
// 配置序列化等信息
return template;
}
// @Bean(name = "redis5Template")
// public RedisTemplate<Object, Object> redis5Template(@Qualifier("redisConnectionFactory5") RedisConnectionFactory redisConnectionFactory5) {
// RedisTemplate<Object, Object> template = new RedisTemplate<>();
// //序列化
// FastJsonRedisSerializer<Object> fastJsonRedisSerializer = new FastJsonRedisSerializer<>(Object.class);
// // value值的序列化采用fastJsonRedisSerializer
// template.setValueSerializer(fastJsonRedisSerializer);
// template.setHashValueSerializer(fastJsonRedisSerializer);
// // key的序列化采用StringRedisSerializer
// template.setKeySerializer(new StringRedisSerializer());
// template.setHashKeySerializer(new StringRedisSerializer());
// template.setConnectionFactory(redisConnectionFactory5);
// // 配置序列化等信息
// return template;
// }
/**
* 设置 redis 数据默认过期时间默认2小时

View File

@@ -41,22 +41,29 @@ import java.util.concurrent.TimeUnit;
public class RedisUtils {
private static final Logger log = LoggerFactory.getLogger(RedisUtils.class);
private RedisTemplate<Object, Object> redisTemplate;
private RedisTemplate<Object, Object> redisTemplate5;
// private RedisTemplate<Object, Object> redisTemplate5;
@Value("${jwt.online-key}")
private String onlineKey;
public RedisUtils(RedisTemplate<Object, Object> redisTemplate,@Qualifier("redis5Template")RedisTemplate<Object, Object> redisTemplate5) {
// public RedisUtils(RedisTemplate<Object, Object> redisTemplate,@Qualifier("redis5Template")RedisTemplate<Object, Object> redisTemplate5) {
// this.redisTemplate = redisTemplate;
// this.redisTemplate.setHashKeySerializer(new StringRedisSerializer());
// this.redisTemplate.setKeySerializer(new StringRedisSerializer());
// this.redisTemplate.setStringSerializer(new StringRedisSerializer());
//
//
// this.redisTemplate5 = redisTemplate5;
// this.redisTemplate5.setHashKeySerializer(new StringRedisSerializer());
// this.redisTemplate5.setKeySerializer(new StringRedisSerializer());
// this.redisTemplate5.setStringSerializer(new StringRedisSerializer());
// }
public RedisUtils(RedisTemplate<Object, Object> redisTemplate) {
this.redisTemplate = redisTemplate;
this.redisTemplate.setHashKeySerializer(new StringRedisSerializer());
this.redisTemplate.setKeySerializer(new StringRedisSerializer());
this.redisTemplate.setStringSerializer(new StringRedisSerializer());
this.redisTemplate5 = redisTemplate5;
this.redisTemplate5.setHashKeySerializer(new StringRedisSerializer());
this.redisTemplate5.setKeySerializer(new StringRedisSerializer());
this.redisTemplate5.setStringSerializer(new StringRedisSerializer());
}
/**
@@ -774,16 +781,15 @@ public class RedisUtils {
* @param value 值
* @return true成功 false失败
*/
public boolean set5(String key, Object value) {
try {
redisTemplate5.opsForValue().set(key, value);
// redisTemplate.opsForValue().set(key, value);
return true;
} catch (Exception e) {
log.error(e.getMessage(), e);
return false;
}
}
// public boolean set5(String key, Object value) {
// try {
// redisTemplate5.opsForValue().set(key, value);
// return true;
// } catch (Exception e) {
// log.error(e.getMessage(), e);
// return false;
// }
// }
/**
@@ -792,26 +798,26 @@ public class RedisUtils {
*
* @param key 可以传一个值 或多个
*/
public void del5(String... keys) {
if (keys != null && keys.length > 0) {
if (keys.length == 1) {
boolean result = redisTemplate5.delete(keys[0]);
log.debug("--------------------------------------------");
log.debug(new StringBuilder("删除缓存:").append(keys[0]).append(",结果:").append(result).toString());
log.debug("--------------------------------------------");
} else {
Set<Object> keySet = new HashSet<>();
for (String key : keys) {
keySet.addAll(redisTemplate5.keys(key));
}
long count = redisTemplate5.delete(keySet);
log.debug("--------------------------------------------");
log.debug("成功删除缓存:" + keySet.toString());
log.debug("缓存删除数量:" + count + "");
log.debug("--------------------------------------------");
}
}
}
// public void del5(String... keys) {
// if (keys != null && keys.length > 0) {
// if (keys.length == 1) {
// boolean result = redisTemplate5.delete(keys[0]);
// log.debug("--------------------------------------------");
// log.debug(new StringBuilder("删除缓存:").append(keys[0]).append(",结果:").append(result).toString());
// log.debug("--------------------------------------------");
// } else {
// Set<Object> keySet = new HashSet<>();
// for (String key : keys) {
// keySet.addAll(redisTemplate5.keys(key));
// }
// long count = redisTemplate5.delete(keySet);
// log.debug("--------------------------------------------");
// log.debug("成功删除缓存:" + keySet.toString());
// log.debug("缓存删除数量:" + count + "个");
// log.debug("--------------------------------------------");
// }
// }
// }
}

View File

@@ -15,10 +15,7 @@
*/
package cn.ysk.cashier.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.lang.annotation.*;
/**
* @author Zheng Jie
@@ -27,5 +24,10 @@ import java.lang.annotation.Target;
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
public @interface Log {
/**
* ("登录授权: #authUser.username") :必填
* 实际会存为 登录授权:用户名
* @return
*/
String value() default "";
}

View File

@@ -0,0 +1,52 @@
package cn.ysk.cashier.service;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.reflect.MethodSignature;
import org.springframework.core.DefaultParameterNameDiscoverer;
import org.springframework.expression.EvaluationContext;
import org.springframework.expression.Expression;
import org.springframework.expression.spel.standard.SpelExpressionParser;
import org.springframework.expression.spel.support.StandardEvaluationContext;
import java.lang.reflect.Method;
public class SpelUtil {
/**
* 用于SpEL表达式解析.
*/
private static final SpelExpressionParser parser = new SpelExpressionParser();
/**
* 用于获取方法参数定义名字.
*/
private static final DefaultParameterNameDiscoverer nameDiscoverer = new DefaultParameterNameDiscoverer();
/**
* 解析SpEL表达式
*
* @param spELStr
* @param joinPoint
* @return
*/
public static String generateKeyBySpEL(String spELStr, ProceedingJoinPoint joinPoint) {
// 通过joinPoint获取被注解方法
MethodSignature methodSignature = (MethodSignature) joinPoint.getSignature();
Method method = methodSignature.getMethod();
// 使用Spring的DefaultParameterNameDiscoverer获取方法形参名数组
String[] paramNames = nameDiscoverer.getParameterNames(method);
// 解析过后的Spring表达式对象
Expression expression = parser.parseExpression(spELStr);
// Spring的表达式上下文对象
EvaluationContext context = new StandardEvaluationContext();
// 通过joinPoint获取被注解方法的形参
Object[] args = joinPoint.getArgs();
// 给上下文赋值
for (int i = 0; i < args.length; i++) {
context.setVariable(paramNames[i], args[i]);
}
if(expression.getValue(context)==null){
return "";
}
return expression.getValue(context).toString();
}
}

View File

@@ -23,6 +23,7 @@ import cn.ysk.cashier.domain.Log;
import cn.ysk.cashier.domain.LogVO;
import cn.ysk.cashier.repository.LogRepository;
import cn.ysk.cashier.service.LogService;
import cn.ysk.cashier.service.SpelUtil;
import cn.ysk.cashier.service.dto.LogQueryCriteria;
import cn.ysk.cashier.service.dto.LogQueryCriteriaExt;
import cn.ysk.cashier.service.mapstruct.LogErrorMapper;
@@ -80,7 +81,7 @@ public class LogServiceImpl implements LogService {
@Override
@Transactional(rollbackFor = Exception.class)
public void save(String username, String browser, String ip, ProceedingJoinPoint joinPoint, Log log,Integer shopId) {
public void save(String username, String browser, String ip, ProceedingJoinPoint joinPoint, Log log, Integer shopId) {
if (log == null) {
throw new IllegalArgumentException("Log 不能为 null!");
}
@@ -90,17 +91,21 @@ public class LogServiceImpl implements LogService {
// 方法路径
String methodName = joinPoint.getTarget().getClass().getName() + "." + signature.getName() + "()";
String[] split = aopLog.value().split(":");
if (split.length == 2) {
String value = SpelUtil.generateKeyBySpEL(split[1], joinPoint);
// 描述
log.setDescription(aopLog.value());
log.setDescription(split[0] + ":" + value);
}else {
log.setDescription(split[0]);
}
log.setRequestIp(ip);
log.setAddress(StringUtils.getCityInfo(log.getRequestIp()));
log.setMethod(methodName);
log.setUsername(username);
log.setParams(getParameter(method, joinPoint.getArgs()));
// 记录登录用户,隐藏密码信息
if(signature.getName().equals("login") && StringUtils.isNotEmpty(log.getParams())){
if (signature.getName().equals("login") && StringUtils.isNotEmpty(log.getParams())) {
JSONObject obj = JSONUtil.parseObj(log.getParams());
log.setUsername(obj.getStr("username", ""));
log.setParams(JSONUtil.toJsonStr(Dict.create().set("username", log.getUsername())));
@@ -182,7 +187,7 @@ public class LogServiceImpl implements LogService {
public Map<String, Object> shopInfoLog(LogQueryCriteriaExt criteria, Pageable pageable) {
Page<Log> page = logRepository.findAll(((root, criteriaQuery, cb) -> QueryHelp.getPredicate(root, criteria, cb)), pageable);
List<LogVO> logVOList = new ArrayList<>();
for (Log log :page.getContent()) {
for (Log log : page.getContent()) {
LogVO logVO = new LogVO();
logVO.setDescription(log.getDescription());
logVO.setCreateTime(log.getCreateTime());
@@ -190,9 +195,9 @@ public class LogServiceImpl implements LogService {
logVO.setRequestIp(log.getRequestIp());
logVOList.add(logVO);
}
Map<String,Object> map = new LinkedHashMap<>(2);
map.put("content",logVOList);
map.put("totalElements",page.getTotalElements());
Map<String, Object> map = new LinkedHashMap<>(2);
map.put("content", logVOList);
map.put("totalElements", page.getTotalElements());
return map;
}

View File

@@ -1,4 +1,4 @@
package me.zhengjie.config;
package cn.ysk.cashier.config;
import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.extension.plugins.*;
@@ -12,7 +12,7 @@ import java.util.Collections;
@Configuration
@MapperScan("me.zhengjie.mybatis.mapper")
@MapperScan("cn.ysk.cashier.mybatis.mapper")
@EnableTransactionManagement
public class MybatisPlusConfig {

View File

@@ -18,6 +18,8 @@ package cn.ysk.cashier.config.security.rest;
import cn.hutool.core.util.IdUtil;
import cn.ysk.cashier.config.security.config.bean.LoginCodeEnum;
import cn.ysk.cashier.config.security.security.TokenProvider;
import cn.ysk.cashier.pojo.shop.TbPlussShopStaff;
import cn.ysk.cashier.repository.shop.TbPlussShopStaffRepository;
import cn.ysk.cashier.utils.*;
import com.wf.captcha.base.Captcha;
import io.swagger.annotations.Api;
@@ -40,16 +42,19 @@ import cn.ysk.cashier.pojo.shop.TbShopInfo;
import cn.ysk.cashier.repository.shop.TbShopInfoRepository;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.TimeUnit;
/**
@@ -69,10 +74,10 @@ public class AuthorizationController {
private final TokenProvider tokenProvider;
private final AuthenticationManagerBuilder authenticationManagerBuilder;
private final TbShopInfoRepository tbShopInfoRepository;
private final TbPlussShopStaffRepository staffRepository;
@Resource
private LoginProperties loginProperties;
@Log("用户登录")
@ApiOperation("登录授权")
@AnonymousPostMapping(value = "/login")
public ResponseEntity<Object> login(@Validated @RequestBody AuthUserDto authUser, HttpServletRequest request) throws Exception {
@@ -97,17 +102,22 @@ public class AuthorizationController {
// UserDetails userDetails = userDetailsService.loadUserByUsername(userInfo.getUsername());
// Authentication authentication = new UsernamePasswordAuthenticationToken(userDetails, null, userDetails.getAuthorities());
// SecurityContextHolder.getContext().setAuthentication(authentication);
String token = tokenProvider.createToken(authentication);
final JwtUserDto jwtUserDto = (JwtUserDto) authentication.getPrincipal();
// 返回 token 与 用户信息
TbShopInfo byAccount = tbShopInfoRepository.findByAccount(jwtUserDto.getUsername());
// TbShopInfo byAccount = tbShopInfoRepository.findByAccount(jwtUserDto.getUsername());
TbPlussShopStaff tbPlussShopStaff = staffRepository.queryByAccount(jwtUserDto.getUsername());
if (tbPlussShopStaff != null && tbPlussShopStaff.getType().equals("staff")) {
Integer isManage = tbPlussShopStaff.getIsManage();
if (isManage != null && isManage != 1) {
throw new BadRequestException("该账号无权限登录,请联系管理员");
}
}
TbShopInfo byAccount = tbShopInfoRepository.findById(Integer.valueOf(tbPlussShopStaff.getShopId())).get();
//校验商户商户激活是否到期(未激活)
String token = tokenProvider.createToken(authentication, tbPlussShopStaff.getShopId());
Map<String, Object> authInfo = new HashMap<String, Object>(2) {{
put("token", properties.getTokenStartWith() + token);
put("user", jwtUserDto);
if (byAccount!= null){
if (byAccount != null) {
put("shopId", byAccount.getId());
put("shopName", byAccount.getShopName());
put("logo", byAccount.getLogo());
@@ -115,7 +125,7 @@ public class AuthorizationController {
}};
// 保存在线信息
onlineUserService.save(jwtUserDto, token, request,byAccount.getId());
onlineUserService.save(jwtUserDto, token, request, byAccount.getId());
if (loginProperties.isSingleLogin()) {
//踢掉之前已经登录的token
@@ -126,13 +136,14 @@ public class AuthorizationController {
/**
* 小程序登录
*
* @param authUser
* @param request
* @return
* @throws Exception
*/
@PostMapping(value = "/appletsLogin")
public ResponseEntity<Object> appletsLogin(@RequestBody AuthUserDto authUser,HttpServletRequest request)throws Exception{
public ResponseEntity<Object> appletsLogin(@RequestBody AuthUserDto authUser, HttpServletRequest request) throws Exception {
// 密码解密
String password = RsaUtils.decryptByPrivateKey(RsaProperties.privateKey, authUser.getPassword());
@@ -140,18 +151,18 @@ public class AuthorizationController {
new UsernamePasswordAuthenticationToken(authUser.getUsername(), password);
Authentication authentication = authenticationManagerBuilder.getObject().authenticate(authenticationToken);
SecurityContextHolder.getContext().setAuthentication(authentication);
// 生成令牌与第三方系统获取令牌方式
String token = tokenProvider.createToken(authentication);
final JwtUserDto jwtUserDto = (JwtUserDto) authentication.getPrincipal();
// 保存在线信息
onlineUserService.save(jwtUserDto, token,request,null);
// 返回 token 与 用户信息
TbShopInfo byAccount = tbShopInfoRepository.findByAccount(jwtUserDto.getUsername());
// 生成令牌与第三方系统获取令牌方式
String token = tokenProvider.createToken(authentication, byAccount.getId().toString());
// 保存在线信息
onlineUserService.save(jwtUserDto, token, request, null);
Map<String, Object> authInfo = new HashMap<String, Object>(2) {{
put("token", properties.getTokenStartWith() + token);
put("user", jwtUserDto);
if (byAccount!= null){
put("shopId",byAccount.getId());
if (byAccount != null) {
put("shopId", byAccount.getId());
}
}};

View File

@@ -18,6 +18,8 @@ package cn.ysk.cashier.config.security.security;
import cn.hutool.core.date.DateField;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil;
import cn.ysk.cashier.utils.SpringContextHolder;
import com.alibaba.fastjson.JSONObject;
import io.jsonwebtoken.*;
import io.jsonwebtoken.io.Decoders;
import io.jsonwebtoken.security.Keys;
@@ -47,6 +49,11 @@ public class TokenProvider implements InitializingBean {
private JwtParser jwtParser;
private JwtBuilder jwtBuilder;
/**
* token秘钥
*/
private static final String TOKEN_SECRET = "BBDFSDFHFGHSGSRTRESDFSDFS";
public TokenProvider(SecurityProperties properties, RedisUtils redisUtils) {
this.properties = properties;
this.redisUtils = redisUtils;
@@ -70,11 +77,12 @@ public class TokenProvider implements InitializingBean {
* @param authentication /
* @return /
*/
public String createToken(Authentication authentication) {
public String createToken(Authentication authentication,String shopId) {
return jwtBuilder
// 加入ID确保生成的 Token 都不一致
.setId(IdUtil.simpleUUID())
.claim(AUTHORITIES_KEY, authentication.getName())
.claim("shopId",shopId)
.setSubject(authentication.getName())
.compact();
}
@@ -120,4 +128,13 @@ public class TokenProvider implements InitializingBean {
}
return null;
}
public String getShopId() {
HttpServletRequest request = SpringContextHolder.getRequest();
final String requestHeader = request.getHeader(properties.getHeader());
if (requestHeader != null && requestHeader.startsWith(properties.getTokenStartWith())) {
return getClaims(requestHeader.substring(7)).get("shopId").toString();
}
return null;
}
}

View File

@@ -43,7 +43,6 @@ public class BotButtonConfigController {
private final BotButtonConfigService botButtonConfigService;
@Log("导出数据")
@ApiOperation("导出数据")
@GetMapping(value = "/download")
@PreAuthorize("@el.check('botButtonConfig:list')")
@@ -52,7 +51,6 @@ public class BotButtonConfigController {
}
@GetMapping
@Log("查询buttonConfig")
@ApiOperation("查询buttonConfig")
@PreAuthorize("@el.check('botButtonConfig:list')")
public ResponseEntity<Object> queryBotButtonConfig(BotButtonConfigQueryCriteria criteria, Pageable pageable){
@@ -60,7 +58,6 @@ public class BotButtonConfigController {
}
@PostMapping
@Log("新增buttonConfig")
@ApiOperation("新增buttonConfig")
@PreAuthorize("@el.check('botButtonConfig:add')")
public ResponseEntity<Object> createBotButtonConfig(@Validated @RequestBody BotButtonConfig resources){
@@ -68,7 +65,6 @@ public class BotButtonConfigController {
}
@PutMapping
@Log("修改buttonConfig")
@ApiOperation("修改buttonConfig")
@PreAuthorize("@el.check('botButtonConfig:edit')")
public ResponseEntity<Object> updateBotButtonConfig(@Validated @RequestBody BotButtonConfig resources){
@@ -77,7 +73,6 @@ public class BotButtonConfigController {
}
@DeleteMapping
@Log("删除buttonConfig")
@ApiOperation("删除buttonConfig")
@PreAuthorize("@el.check('botButtonConfig:del')")
public ResponseEntity<Object> deleteBotButtonConfig(@RequestBody Integer[] ids) {

View File

@@ -43,7 +43,6 @@ public class BotConfigController {
private final BotConfigService botConfigService;
@Log("导出数据")
@ApiOperation("导出数据")
@GetMapping(value = "/download")
@PreAuthorize("@el.check('botConfig:list')")
@@ -52,7 +51,6 @@ public class BotConfigController {
}
@GetMapping
@Log("查询botConfig")
@ApiOperation("查询botConfig")
@PreAuthorize("@el.check('botConfig:list')")
public ResponseEntity<Object> queryBotConfig(BotConfigQueryCriteria criteria, Pageable pageable){
@@ -60,7 +58,6 @@ public class BotConfigController {
}
@PostMapping
@Log("新增botConfig")
@ApiOperation("新增botConfig")
@PreAuthorize("@el.check('botConfig:add')")
public ResponseEntity<Object> createBotConfig(@Validated @RequestBody BotConfig resources){
@@ -68,7 +65,6 @@ public class BotConfigController {
}
@PutMapping
@Log("修改botConfig")
@ApiOperation("修改botConfig")
@PreAuthorize("@el.check('botConfig:edit')")
public ResponseEntity<Object> updateBotConfig(@Validated @RequestBody BotConfig resources){
@@ -77,7 +73,6 @@ public class BotConfigController {
}
@DeleteMapping
@Log("删除botConfig")
@ApiOperation("删除botConfig")
@PreAuthorize("@el.check('botConfig:del')")
public ResponseEntity<Object> deleteBotConfig(@RequestBody Integer[] ids) {

View File

@@ -43,7 +43,6 @@ public class BotUserController {
private final BotUserService botUserService;
@Log("导出数据")
@ApiOperation("导出数据")
@GetMapping(value = "/download")
@PreAuthorize("@el.check('botUser:list')")
@@ -52,7 +51,6 @@ public class BotUserController {
}
@GetMapping
@Log("查询BotUserController")
@ApiOperation("查询BotUserController")
@PreAuthorize("@el.check('botUser:list')")
public ResponseEntity<Object> queryBotUser(BotUserQueryCriteria criteria, Pageable pageable){
@@ -60,7 +58,6 @@ public class BotUserController {
}
@PostMapping
@Log("新增BotUserController")
@ApiOperation("新增BotUserController")
@PreAuthorize("@el.check('botUser:add')")
public ResponseEntity<Object> createBotUser(@Validated @RequestBody BotUser resources){
@@ -68,7 +65,6 @@ public class BotUserController {
}
@PutMapping
@Log("修改BotUserController")
@ApiOperation("修改BotUserController")
@PreAuthorize("@el.check('botUser:edit')")
public ResponseEntity<Object> updateBotUser(@Validated @RequestBody BotUser resources){
@@ -77,7 +73,6 @@ public class BotUserController {
}
@DeleteMapping
@Log("删除BotUserController")
@ApiOperation("删除BotUserController")
@PreAuthorize("@el.check('botUser:del')")
public ResponseEntity<Object> deleteBotUser(@RequestBody Integer[] ids) {

View File

@@ -43,7 +43,6 @@ public class BotUserFlowController {
private final BotUserFlowService botUserFlowService;
@Log("导出数据")
@ApiOperation("导出数据")
@GetMapping(value = "/download")
@PreAuthorize("@el.check('botUserFlow:list')")
@@ -52,7 +51,6 @@ public class BotUserFlowController {
}
@GetMapping
@Log("查询accountFlow")
@ApiOperation("查询accountFlow")
@PreAuthorize("@el.check('botUserFlow:list')")
public ResponseEntity<Object> queryBotUserFlow(BotUserFlowQueryCriteria criteria, Pageable pageable){
@@ -60,7 +58,6 @@ public class BotUserFlowController {
}
@PostMapping
@Log("新增accountFlow")
@ApiOperation("新增accountFlow")
@PreAuthorize("@el.check('botUserFlow:add')")
public ResponseEntity<Object> createBotUserFlow(@Validated @RequestBody BotUserFlow resources){
@@ -68,7 +65,6 @@ public class BotUserFlowController {
}
@PutMapping
@Log("修改accountFlow")
@ApiOperation("修改accountFlow")
@PreAuthorize("@el.check('botUserFlow:edit')")
public ResponseEntity<Object> updateBotUserFlow(@Validated @RequestBody BotUserFlow resources){
@@ -77,7 +73,6 @@ public class BotUserFlowController {
}
@DeleteMapping
@Log("删除accountFlow")
@ApiOperation("删除accountFlow")
@PreAuthorize("@el.check('botUserFlow:del')")
public ResponseEntity<Object> deleteBotUserFlow(@RequestBody Integer[] ids) {

View File

@@ -27,27 +27,23 @@ public class TbPlatformDictController {
private final TbPlatformDictService tbPlatformDictService;
@GetMapping
@Log("查询新字典")
@ApiOperation("查询新字典")
public ResponseEntity<Object> queryTbPlatformDict(TbPlatformDictQueryCriteria criteria){
return new ResponseEntity<>(tbPlatformDictService.queryAllPage(criteria),HttpStatus.OK);
}
@GetMapping("/{id}")
@Log("通过Id查询新字典")
@ApiOperation("通过Id查询新字典")
public TbPlatformDictDto queryTbOrderInfo(@PathVariable("id") Integer id){
return tbPlatformDictService.findById(id);
}
@PostMapping
@Log("新增新字典")
@ApiOperation("新增新字典")
public ResponseEntity<Object> createTbPlatformDict(@Validated @RequestBody TbPlatformDict resources){
return new ResponseEntity<>(tbPlatformDictService.create(resources),HttpStatus.CREATED);
}
@PutMapping
@Log("修改新字典")
@ApiOperation("修改新字典")
public ResponseEntity<Object> updateTbPlatformDict(@Validated @RequestBody TbPlatformDict resources){
tbPlatformDictService.update(resources);
@@ -55,7 +51,6 @@ public class TbPlatformDictController {
}
@DeleteMapping
@Log("删除新字典")
@ApiOperation("删除新字典")
public ResponseEntity<Object> deleteTbPlatformDict(@RequestBody Integer[] ids) {
tbPlatformDictService.deleteAll(ids);

View File

@@ -43,7 +43,6 @@ public class TbRenewalsPayLogController {
private final TbRenewalsPayLogService tbRenewalsPayLogService;
@Log("导出数据")
@ApiOperation("导出数据")
@GetMapping(value = "/download")
@PreAuthorize("@el.check('tbRenewalsPayLog:list')")
@@ -52,7 +51,6 @@ public class TbRenewalsPayLogController {
}
@GetMapping
@Log("查询/shop/renewals")
@ApiOperation("查询/shop/renewals")
@PreAuthorize("@el.check('tbRenewalsPayLog:list')")
public ResponseEntity<Object> queryTbRenewalsPayLog(TbRenewalsPayLogQueryCriteria criteria, Pageable pageable){
@@ -60,7 +58,6 @@ public class TbRenewalsPayLogController {
}
@PostMapping
@Log("新增/shop/renewals")
@ApiOperation("新增/shop/renewals")
@PreAuthorize("@el.check('tbRenewalsPayLog:add')")
public ResponseEntity<Object> createTbRenewalsPayLog(@Validated @RequestBody TbRenewalsPayLog resources){
@@ -68,7 +65,6 @@ public class TbRenewalsPayLogController {
}
@PutMapping
@Log("修改/shop/renewals")
@ApiOperation("修改/shop/renewals")
@PreAuthorize("@el.check('tbRenewalsPayLog:edit')")
public ResponseEntity<Object> updateTbRenewalsPayLog(@Validated @RequestBody TbRenewalsPayLog resources){
@@ -77,7 +73,6 @@ public class TbRenewalsPayLogController {
}
@DeleteMapping
@Log("删除/shop/renewals")
@ApiOperation("删除/shop/renewals")
@PreAuthorize("@el.check('tbRenewalsPayLog:del')")
public ResponseEntity<Object> deleteTbRenewalsPayLog(@RequestBody Integer[] ids) {

View File

@@ -42,7 +42,6 @@ public class TbShopPayTypeController {
private final TbShopPayTypeService tbShopPayTypeService;
@Log("导出数据")
@ApiOperation("导出数据")
@GetMapping(value = "/download")
public void exportTbShopPayType(HttpServletResponse response, TbShopPayTypeQueryCriteria criteria) throws IOException {
@@ -50,28 +49,23 @@ public class TbShopPayTypeController {
}
@GetMapping
@Log("查询/merchant/system/paytype")
@ApiOperation("查询/merchant/system/paytype")
public ResponseEntity<Object> queryTbShopPayType(TbShopPayTypeQueryCriteria criteria, Pageable pageable){
return new ResponseEntity<>(tbShopPayTypeService.queryAll(criteria,pageable),HttpStatus.OK);
}
@PostMapping
@Log("新增/merchant/system/paytype")
@ApiOperation("新增/merchant/system/paytype")
public ResponseEntity<Object> createTbShopPayType(@Validated @RequestBody TbShopPayType resources){
return new ResponseEntity<>(tbShopPayTypeService.create(resources),HttpStatus.CREATED);
}
@GetMapping("/{id}")
@Log("新增/merchant/system/paytype")
@ApiOperation("新增/merchant/system/paytype")
public ResponseEntity<Object> TbShopPayTypeInfo(@PathVariable Integer id){
return new ResponseEntity<>(tbShopPayTypeService.findById(id),HttpStatus.CREATED);
}
@PutMapping
@Log("修改/merchant/system/paytype")
@ApiOperation("修改/merchant/system/paytype")
public ResponseEntity<Object> updateTbShopPayType(@Validated @RequestBody TbShopPayType resources){
tbShopPayTypeService.update(resources);
@@ -79,7 +73,6 @@ public class TbShopPayTypeController {
}
@DeleteMapping
@Log("删除/merchant/system/paytype")
@ApiOperation("删除/merchant/system/paytype")
public ResponseEntity<Object> deleteTbShopPayType(@RequestBody Integer[] ids) {
tbShopPayTypeService.deleteAll(ids);

View File

@@ -43,7 +43,6 @@ public class TbUserInfoController {
private final TbUserInfoService tbUserInfoService;
@Log("导出数据")
@ApiOperation("导出数据")
@GetMapping(value = "/download")
@PreAuthorize("@el.check('tbUserInfo:list')")
@@ -52,21 +51,18 @@ public class TbUserInfoController {
}
@GetMapping
@Log("查询/userInfo/list")
@ApiOperation("查询/userInfo/list")
public ResponseEntity<Object> queryTbUserInfo(TbUserInfoQueryCriteria criteria, Pageable pageable){
return new ResponseEntity<>(tbUserInfoService.queryAll(criteria,pageable),HttpStatus.OK);
}
@PostMapping
@Log("新增/userInfo/list")
@ApiOperation("新增/userInfo/list")
public ResponseEntity<Object> createTbUserInfo(@Validated @RequestBody TbUserInfo resources){
return new ResponseEntity<>(tbUserInfoService.create(resources),HttpStatus.CREATED);
}
@PutMapping
@Log("修改/userInfo/list")
@ApiOperation("修改/userInfo/list")
public ResponseEntity<Object> updateTbUserInfo(@Validated @RequestBody TbUserInfo resources){
tbUserInfoService.update(resources);
@@ -74,7 +70,6 @@ public class TbUserInfoController {
}
@DeleteMapping
@Log("删除/userInfo/list")
@ApiOperation("删除/userInfo/list")
public ResponseEntity<Object> deleteTbUserInfo(@RequestBody Integer[] ids) {
tbUserInfoService.deleteAll(ids);

View File

@@ -22,21 +22,18 @@ public class TbVersionController {
private final TbVersionService tbVersionService;
@GetMapping
@Log("查询版本")
@ApiOperation("查询版本")
public ResponseEntity<Object> queryTbVersion(TbVersionQueryCriteria criteria){
return new ResponseEntity<>(tbVersionService.queryAllPage(criteria),HttpStatus.OK);
}
@PostMapping
@Log("新增版本")
@ApiOperation("新增版本")
public ResponseEntity<Object> createTbVersion(@Validated @RequestBody TbVersion resources){
return new ResponseEntity<>(tbVersionService.create(resources),HttpStatus.CREATED);
}
@PutMapping
@Log("修改版本")
@ApiOperation("修改版本")
public ResponseEntity<Object> updateTbVersion(@Validated @RequestBody TbVersion resources){
tbVersionService.update(resources);
@@ -44,7 +41,6 @@ public class TbVersionController {
}
@DeleteMapping
@Log("删除版本")
@ApiOperation("删除版本")
public ResponseEntity<Object> deleteTbVersion(@RequestBody Integer[] ids) {
tbVersionService.deleteAll(ids);

View File

@@ -1,81 +0,0 @@
/*
* Copyright 2019-2020 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.ysk.cashier.controller.order;
import cn.ysk.cashier.annotation.Log;
import cn.ysk.cashier.pojo.order.TbCashierCart;
import cn.ysk.cashier.service.order.TbCashierCartService;
import cn.ysk.cashier.dto.order.TbCashierCartQueryCriteria;
import org.springframework.data.domain.Pageable;
import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import io.swagger.annotations.*;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;
/**
* @website https://eladmin.vip
* @author lyf
* @date 2024-03-02
**/
@RestController
@RequiredArgsConstructor
@Api(tags = "购物车管理")
@RequestMapping("/api/tbCashierCart")
public class TbCashierCartController {
private final TbCashierCartService tbCashierCartService;
@Log("导出数据")
@ApiOperation("导出数据")
@GetMapping(value = "/download")
public void exportTbCashierCart(HttpServletResponse response, TbCashierCartQueryCriteria criteria) throws IOException {
tbCashierCartService.download(tbCashierCartService.queryAll(criteria), response);
}
@GetMapping
@Log("查询购物车")
@ApiOperation("查询购物车")
public ResponseEntity<Object> queryTbCashierCart(TbCashierCartQueryCriteria criteria, Pageable pageable){
return new ResponseEntity<>(tbCashierCartService.queryAll(criteria,pageable),HttpStatus.OK);
}
@PostMapping
@Log("新增购物车")
@ApiOperation("新增购物车")
public ResponseEntity<Object> createTbCashierCart(@Validated @RequestBody TbCashierCart resources){
return new ResponseEntity<>(tbCashierCartService.create(resources),HttpStatus.CREATED);
}
@PutMapping
@Log("修改购物车")
@ApiOperation("修改购物车")
public ResponseEntity<Object> updateTbCashierCart(@Validated @RequestBody TbCashierCart resources){
tbCashierCartService.update(resources);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
@DeleteMapping
@Log("删除购物车")
@ApiOperation("删除购物车")
public ResponseEntity<Object> deleteTbCashierCart(@RequestBody Integer[] ids) {
tbCashierCartService.deleteAll(ids);
return new ResponseEntity<>(HttpStatus.OK);
}
}

View File

@@ -1,81 +0,0 @@
/*
* Copyright 2019-2020 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.ysk.cashier.controller.order;
import cn.ysk.cashier.annotation.Log;
import cn.ysk.cashier.pojo.order.TbOrderDetail;
import cn.ysk.cashier.service.order.TbOrderDetailService;
import cn.ysk.cashier.dto.order.TbOrderDetailQueryCriteria;
import org.springframework.data.domain.Pageable;
import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import io.swagger.annotations.*;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;
/**
* @website https://eladmin.vip
* @author lyf
* @date 2024-03-02
**/
@RestController
@RequiredArgsConstructor
@Api(tags = "订单详情")
@RequestMapping("/api/tbOrderDetail")
public class TbOrderDetailController {
private final TbOrderDetailService tbOrderDetailService;
@Log("导出数据")
@ApiOperation("导出数据")
@GetMapping(value = "/download")
public void exportTbOrderDetail(HttpServletResponse response, TbOrderDetailQueryCriteria criteria) throws IOException {
tbOrderDetailService.download(tbOrderDetailService.queryAll(criteria), response);
}
@GetMapping
@Log("查询订单详情")
@ApiOperation("查询订单详情")
public ResponseEntity<Object> queryTbOrderDetail(TbOrderDetailQueryCriteria criteria, Pageable pageable){
return new ResponseEntity<>(tbOrderDetailService.queryAll(criteria,pageable),HttpStatus.OK);
}
@PostMapping
@Log("新增订单详情")
@ApiOperation("新增订单详情")
public ResponseEntity<Object> createTbOrderDetail(@Validated @RequestBody TbOrderDetail resources){
return new ResponseEntity<>(tbOrderDetailService.create(resources),HttpStatus.CREATED);
}
@PutMapping
@Log("修改订单详情")
@ApiOperation("修改订单详情")
public ResponseEntity<Object> updateTbOrderDetail(@Validated @RequestBody TbOrderDetail resources){
tbOrderDetailService.update(resources);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
@DeleteMapping
@Log("删除订单详情")
@ApiOperation("删除订单详情")
public ResponseEntity<Object> deleteTbOrderDetail(@RequestBody Integer[] ids) {
tbOrderDetailService.deleteAll(ids);
return new ResponseEntity<>(HttpStatus.OK);
}
}

View File

@@ -47,7 +47,6 @@ public class TbOrderInfoController {
private final TbOrderInfoService tbOrderInfoService;
@Log("导出数据")
@ApiOperation("导出数据")
@PostMapping(value = "/download")
public void exportTbOrderInfo(HttpServletResponse response, @RequestBody TbOrderInfoQueryCriteria criteria) throws IOException {
@@ -55,46 +54,40 @@ public class TbOrderInfoController {
}
@PostMapping("/date")
@Log("查询订单")
@ApiOperation("查询订单")
public ResponseEntity<Object> queryTbOrderInfo(@RequestBody TbOrderInfoQueryCriteria criteria){
return new ResponseEntity<>(tbOrderInfoService.queryAllPage(criteria),HttpStatus.OK);
}
@PostMapping("/payCount")
@Log("通过shopId查询支付统计")
@ApiOperation("通过shopId查询支付统计")
public List<TbOrderPayCountVo> queryTbOrderPayCount(@RequestBody TbPayCountQueryCriteria criteria){
return tbOrderInfoService.queryTbOrderPayCount(criteria);
}
@GetMapping("/{id}")
@Log("通过Id查询订单")
@ApiOperation("通过Id查询订单")
public TbOrderInfoDto queryTbOrderInfo(@PathVariable("id") Integer id){
return tbOrderInfoService.findById(id);
}
@PostMapping
@Log("新增订单")
@ApiOperation("新增订单")
public ResponseEntity<Object> createTbOrderInfo(@Validated @RequestBody TbOrderInfo resources){
return new ResponseEntity<>(tbOrderInfoService.create(resources),HttpStatus.CREATED);
}
// @PostMapping
// @ApiOperation("新增订单")
// public ResponseEntity<Object> createTbOrderInfo(@Validated @RequestBody TbOrderInfo resources){
// return new ResponseEntity<>(tbOrderInfoService.create(resources),HttpStatus.CREATED);
// }
@PutMapping
@Log("修改订单")
@ApiOperation("修改订单")
public ResponseEntity<Object> updateTbOrderInfo(@Validated @RequestBody TbOrderInfo resources){
tbOrderInfoService.update(resources);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
// @PutMapping
// @ApiOperation("修改订单")
// public ResponseEntity<Object> updateTbOrderInfo(@Validated @RequestBody TbOrderInfo resources){
// tbOrderInfoService.update(resources);
// return new ResponseEntity<>(HttpStatus.NO_CONTENT);
// }
@DeleteMapping
@Log("删除订单")
@ApiOperation("删除订单")
public ResponseEntity<Object> deleteTbOrderInfo(@RequestBody Integer[] ids) {
tbOrderInfoService.deleteAll(ids);
return new ResponseEntity<>(HttpStatus.OK);
}
// @DeleteMapping
// @ApiOperation("删除订单")
// public ResponseEntity<Object> deleteTbOrderInfo(@RequestBody Integer[] ids) {
// tbOrderInfoService.deleteAll(ids);
// return new ResponseEntity<>(HttpStatus.OK);
// }
}

View File

@@ -45,7 +45,6 @@ public class TbProductController {
private final TbProductService tbProductService;
@GetMapping
@Log("查询/product")
@ApiOperation("查询/product")
public ResponseEntity<Object> queryTbProduct(TbProductQueryCriteria criteria){
return new ResponseEntity<>(tbProductService.queryAll(criteria),HttpStatus.OK);
@@ -58,13 +57,11 @@ public class TbProductController {
}
@GetMapping("/{product}")
@Log("查询/product")
@ApiOperation("查询/product")
public Object queryTbProductInfo(@PathVariable("product") Integer product)throws Exception{
return tbProductService.findByProductId(product);
}
@GetMapping ("/productList")
@Log("查询/product")
@ApiOperation("查询/product")
public Object queryTbProductInfo(@RequestParam List<String> productList){
return tbProductService.findByProductList(productList);
@@ -72,14 +69,14 @@ public class TbProductController {
@PostMapping
@Log("新增/product")
@Log("新增商品:#resources.name")
@ApiOperation("新增/product")
public ResponseEntity<Object> createTbProduct(@Validated @RequestBody TbProductVo resources){
return new ResponseEntity<>(tbProductService.create(resources),HttpStatus.CREATED);
}
@PutMapping
@Log("修改/product")
@Log("修改商品:#resources.name")
@ApiOperation("修改/product")
public ResponseEntity<Object> updateTbProduct(@Validated @RequestBody TbProductVo resources){
tbProductService.update(resources);
@@ -87,7 +84,7 @@ public class TbProductController {
}
@DeleteMapping
@Log("删除/product")
@Log("删除商品:#ids")
@ApiOperation("删除/product")
public ResponseEntity<Object> deleteTbProduct(@RequestBody Integer[] ids) {
tbProductService.deleteAll(ids);

View File

@@ -50,7 +50,6 @@ public class TbProductGroupController {
@Resource
private TbProductService tbProductService;
@Log("导出数据")
@ApiOperation("导出数据")
@GetMapping(value = "/download")
@PreAuthorize("@el.check('tbProductGroup:list')")
@@ -59,14 +58,12 @@ public class TbProductGroupController {
}
@GetMapping
@Log("查询product/group")
@ApiOperation("查询product/group")
public ResponseEntity<Object> queryTbProductGroup(TbProductGroupQueryCriteria criteria, Pageable pageable){
return new ResponseEntity<>(tbProductGroupService.queryAll(criteria,pageable),HttpStatus.OK);
}
@GetMapping("/{productGroup}")
@Log("查询product/group")
@ApiOperation("查询product/group")
public ResponseEntity<Object> queryTbProductGroup(@PathVariable("productGroup") Integer productGroup){
return new ResponseEntity<>(tbProductGroupService.findByIdProduct(productGroup),HttpStatus.OK);
@@ -74,23 +71,23 @@ public class TbProductGroupController {
@PostMapping
@Log("新增product/group")
@ApiOperation("新增product/group")
@Log("新增商品分组:#resources.name")
@ApiOperation("新增商品分组")
public ResponseEntity<Object> createTbProductGroup(@Validated @RequestBody TbProductGroup resources){
return new ResponseEntity<>(tbProductGroupService.create(resources),HttpStatus.CREATED);
}
@PutMapping
@Log("修改product/group")
@ApiOperation("修改product/group")
@Log("修改商品分组:#resources.name")
@ApiOperation("修改商品分组")
public ResponseEntity<Object> updateTbProductGroup(@Validated @RequestBody TbProductGroup resources){
tbProductGroupService.update(resources);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
@DeleteMapping
@Log("删除product/group")
@ApiOperation("删除product/group")
@Log("删除商品分组:#ids")
@ApiOperation("删除商品分组")
public ResponseEntity<Object> deleteTbProductGroup(@RequestBody Integer[] ids) {
tbProductGroupService.deleteAll(ids);
return new ResponseEntity<>(HttpStatus.OK);
@@ -111,6 +108,7 @@ public class TbProductGroupController {
* @param userName
* @return
*/
@Log("商品分组增加商品")
@PostMapping("/addProductInfo")
public ResponseEntity<Object> addProductInfo(@RequestBody AddProduct addProduct,@RequestAttribute(value = "userName", required = false) String userName){
return new ResponseEntity<>(tbProductGroupService.updateProductIds(addProduct,userName),HttpStatus.OK);

View File

@@ -43,7 +43,6 @@ public class TbProductSkuController {
private final TbProductSkuService tbProductSkuService;
@Log("导出数据")
@ApiOperation("导出数据")
@GetMapping(value = "/download")
@PreAuthorize("@el.check('tbProductSku:list')")
@@ -52,7 +51,6 @@ public class TbProductSkuController {
}
@GetMapping
@Log("查询/product/sku")
@ApiOperation("查询/product/sku")
@PreAuthorize("@el.check('tbProductSku:list')")
public ResponseEntity<Object> queryTbProductSku(TbProductSkuQueryCriteria criteria, Pageable pageable){
@@ -60,7 +58,6 @@ public class TbProductSkuController {
}
@PostMapping
@Log("新增/product/sku")
@ApiOperation("新增/product/sku")
@PreAuthorize("@el.check('tbProductSku:add')")
public ResponseEntity<Object> createTbProductSku(@Validated @RequestBody TbProductSku resources){
@@ -68,7 +65,6 @@ public class TbProductSkuController {
}
@PutMapping
@Log("修改/product/sku")
@ApiOperation("修改/product/sku")
@PreAuthorize("@el.check('tbProductSku:edit')")
public ResponseEntity<Object> updateTbProductSku(@Validated @RequestBody TbProductSku resources){
@@ -77,7 +73,6 @@ public class TbProductSkuController {
}
@DeleteMapping
@Log("删除/product/sku")
@ApiOperation("删除/product/sku")
@PreAuthorize("@el.check('tbProductSku:del')")
public ResponseEntity<Object> deleteTbProductSku(@RequestBody Integer[] ids) {

View File

@@ -43,7 +43,6 @@ public class TbProductSkuResultController {
private final TbProductSkuResultService tbProductSkuResultService;
@Log("导出数据")
@ApiOperation("导出数据")
@GetMapping(value = "/download")
@PreAuthorize("@el.check('tbProductSkuResult:list')")
@@ -52,7 +51,6 @@ public class TbProductSkuResultController {
}
@GetMapping
@Log("查询/skuResult")
@ApiOperation("查询/skuResult")
@PreAuthorize("@el.check('tbProductSkuResult:list')")
public ResponseEntity<Object> queryTbProductSkuResult(TbProductSkuResultQueryCriteria criteria, Pageable pageable){
@@ -60,7 +58,6 @@ public class TbProductSkuResultController {
}
@PostMapping
@Log("新增/skuResult")
@ApiOperation("新增/skuResult")
@PreAuthorize("@el.check('tbProductSkuResult:add')")
public ResponseEntity<Object> createTbProductSkuResult(@Validated @RequestBody TbProductSkuResult resources){
@@ -68,7 +65,6 @@ public class TbProductSkuResultController {
}
@PutMapping
@Log("修改/skuResult")
@ApiOperation("修改/skuResult")
@PreAuthorize("@el.check('tbProductSkuResult:edit')")
public ResponseEntity<Object> updateTbProductSkuResult(@Validated @RequestBody TbProductSkuResult resources){
@@ -77,7 +73,6 @@ public class TbProductSkuResultController {
}
@DeleteMapping
@Log("删除/skuResult")
@ApiOperation("删除/skuResult")
@PreAuthorize("@el.check('tbProductSkuResult:del')")
public ResponseEntity<Object> deleteTbProductSkuResult(@RequestBody Integer[] ids) {

View File

@@ -44,7 +44,6 @@ public class TbProductSpecController {
private final TbProductSpecService tbProductSpecService;
@Log("导出数据")
@ApiOperation("导出数据")
@GetMapping(value = "/download")
@PreAuthorize("@el.check('tbProductSpec:list')")
@@ -53,21 +52,20 @@ public class TbProductSpecController {
}
@GetMapping
@Log("查询product/spec")
@ApiOperation("查询product/spec")
public ResponseEntity<Object> queryTbProductSpec(TbProductSpecQueryCriteria criteria, Pageable pageable){
return new ResponseEntity<>(tbProductSpecService.queryAll(criteria,pageable),HttpStatus.OK);
}
@PostMapping
@Log("新增product/spec")
@Log("新增商品规格:#resources.name")
@ApiOperation("新增product/spec")
public ResponseEntity<Object> createTbProductSpec(@Validated @RequestBody SpecDto resources){
return new ResponseEntity<>(tbProductSpecService.create(resources),HttpStatus.CREATED);
}
@PutMapping
@Log("修改product/spec")
@Log("修改商品规格:#resources.name")
@ApiOperation("修改product/spec")
public ResponseEntity<Object> updateTbProductSpec(@Validated @RequestBody TbProductSpec resources){
tbProductSpecService.update(resources);
@@ -75,7 +73,7 @@ public class TbProductSpecController {
}
@DeleteMapping
@Log("删除product/spec")
@Log("删除商品规格:#ids")
@ApiOperation("删除product/spec")
public ResponseEntity<Object> deleteTbProductSpec(@RequestBody Integer[] ids) {
tbProductSpecService.deleteAll(ids);

View File

@@ -43,7 +43,6 @@ public class TbProductStockDetailController {
private final TbProductStockDetailService tbProductStockDetailService;
@Log("导出数据")
@ApiOperation("导出数据")
@GetMapping(value = "/download")
public void exportTbProductStockDetail(HttpServletResponse response, TbProductStockDetailQueryCriteria criteria) throws IOException {
@@ -51,20 +50,17 @@ public class TbProductStockDetailController {
}
@GetMapping
@Log("查询/product/Stock")
@ApiOperation("查询/product/Stock")
public ResponseEntity<Object> queryTbProductStockDetail(TbProductStockDetailQueryCriteria criteria, Pageable pageable){
return new ResponseEntity<>(tbProductStockDetailService.queryAll(criteria,pageable),HttpStatus.OK);
}
@PostMapping("/stock")
@Log("查询/product/Stock")
@ApiOperation("查询/product/Stock")
public ResponseEntity<Object> queryPage(@RequestBody TbProductStockDetailQueryCriteria criteria){
return new ResponseEntity<>(tbProductStockDetailService.queryPage(criteria),HttpStatus.OK);
}
@GetMapping("/sum")
@Log("查询/product/Stock")
public ResponseEntity<Object> sumType(TbProductStockDetailQueryCriteria criteria){
return new ResponseEntity<>(tbProductStockDetailService.sumStockNumber(criteria.getProductId()),HttpStatus.OK);
}
@@ -76,14 +72,13 @@ public class TbProductStockDetailController {
* @return
*/
@PostMapping
@Log("新增/product/Stock")
@Log("出入库:#resources.productName")
@ApiOperation("新增/product/Stock")
public ResponseEntity<Object> createTbProductStockDetail(@Validated @RequestBody TbProductStockDetail resources){
return new ResponseEntity<>(tbProductStockDetailService.create(resources),HttpStatus.CREATED);
}
@PutMapping
@Log("修改/product/Stock")
@ApiOperation("修改/product/Stock")
public ResponseEntity<Object> updateTbProductStockDetail(@Validated @RequestBody TbProductStockDetail resources){
tbProductStockDetailService.update(resources);
@@ -91,7 +86,6 @@ public class TbProductStockDetailController {
}
@DeleteMapping
@Log("删除/product/Stock")
@ApiOperation("删除/product/Stock")
public ResponseEntity<Object> deleteTbProductStockDetail(@RequestBody Long[] ids) {
tbProductStockDetailService.deleteAll(ids);

View File

@@ -43,7 +43,6 @@ public class TbProductStockOperateController {
private final TbProductStockOperateService tbProductStockOperateService;
@Log("导出数据")
@ApiOperation("导出数据")
@GetMapping(value = "/download")
@PreAuthorize("@el.check('tbProductStockOperate:list')")
@@ -69,7 +68,6 @@ public class TbProductStockOperateController {
@PostMapping
@Log("新增/product/StockOperate")
@ApiOperation("新增/product/StockOperate")
@PreAuthorize("@el.check('tbProductStockOperate:add')")
public ResponseEntity<Object> createTbProductStockOperate(@Validated @RequestBody TbProductStockOperate resources){
@@ -77,7 +75,6 @@ public class TbProductStockOperateController {
}
@PostMapping("/outAndOn")
@Log("新增/product/StockOperate")
@ApiOperation("新增/product/StockOperate")
// @PreAuthorize("@el.check('tbProductStockOperate:add')")
public ResponseEntity<Object> createOutAndONOperate(@RequestBody OutAndOnDto outAndOnDto){
@@ -85,7 +82,6 @@ public class TbProductStockOperateController {
}
@PutMapping
@Log("修改/product/StockOperate")
@ApiOperation("修改/product/StockOperate")
@PreAuthorize("@el.check('tbProductStockOperate:edit')")
public ResponseEntity<Object> updateTbProductStockOperate(@Validated @RequestBody TbProductStockOperate resources){
@@ -94,7 +90,6 @@ public class TbProductStockOperateController {
}
@DeleteMapping
@Log("删除/product/StockOperate")
@ApiOperation("删除/product/StockOperate")
@PreAuthorize("@el.check('tbProductStockOperate:del')")
public ResponseEntity<Object> deleteTbProductStockOperate(@RequestBody Integer[] ids) {

View File

@@ -52,21 +52,20 @@ public class TbShopCategoryController {
// }
@GetMapping
@Log("查询product/category")
@ApiOperation("查询product/category")
public ResponseEntity<Object> queryTbShopCategory(TbShopCategoryQueryCriteria criteria){
return new ResponseEntity<>(tbShopCategoryService.queryAll(criteria),HttpStatus.OK);
}
@PostMapping
@Log("新增product/category")
@Log("新增商品分类:#resources.name")
@ApiOperation("新增product/category")
public ResponseEntity<Object> createTbShopCategory(@Validated @RequestBody TbShopCategory resources){
return new ResponseEntity<>(tbShopCategoryService.create(resources),HttpStatus.CREATED);
}
@PutMapping
@Log("修改product/category")
@Log("修改商品分类:#resources.name")
@ApiOperation("修改product/category")
public ResponseEntity<Object> updateTbShopCategory(@Validated @RequestBody TbShopCategory resources){
tbShopCategoryService.update(resources);
@@ -74,7 +73,7 @@ public class TbShopCategoryController {
}
@DeleteMapping
@Log("删除product/category")
@Log("删除商品分类:#ids")
@ApiOperation("删除product/category")
public ResponseEntity<Object> deleteTbShopCategory(@RequestBody Integer[] ids) {

View File

@@ -27,7 +27,6 @@ public class SummaryByDayController {
@Autowired
private SummaryService summaryService;
@Log("导出数据")
@ApiOperation("导出数据")
@PostMapping(value = "download")
public void exportTbOrderInfo(HttpServletResponse response, @RequestBody ShopSummaryDto exportRequest) throws IOException {

View File

@@ -0,0 +1,57 @@
package cn.ysk.cashier.controller.shop;
import cn.ysk.cashier.annotation.Log;
import cn.ysk.cashier.pojo.shop.TbCouponCategory;
import cn.ysk.cashier.dto.shop.TbCouponCategoryQueryCriteria;
import cn.ysk.cashier.service.shop.TbCouponCategoryService;
import org.springframework.data.domain.Pageable;
import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import io.swagger.annotations.*;
/**
* @website https://eladmin.vip
* @author ww
* @date 2024-04-25
**/
@RestController
@RequiredArgsConstructor
@Api(tags = "团购卷类别管理")
@RequestMapping("/api/tbCouponCategory")
public class TbCouponCategoryController {
private final TbCouponCategoryService tbCouponCategoryService;
@GetMapping
@Log("查询团购卷类别")
@ApiOperation("查询团购卷类别")
public ResponseEntity<Object> queryTbCouponCategory(TbCouponCategoryQueryCriteria criteria, Pageable pageable){
return new ResponseEntity<>(tbCouponCategoryService.queryAll(criteria,pageable),HttpStatus.OK);
}
@PostMapping
@Log("新增团购卷类别")
@ApiOperation("新增团购卷类别")
public ResponseEntity<Object> createTbCouponCategory(@Validated @RequestBody TbCouponCategory resources){
return new ResponseEntity<>(tbCouponCategoryService.create(resources),HttpStatus.CREATED);
}
@PutMapping
@Log("修改团购卷类别")
@ApiOperation("修改团购卷类别")
public ResponseEntity<Object> updateTbCouponCategory(@Validated @RequestBody TbCouponCategory resources){
tbCouponCategoryService.update(resources);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
@DeleteMapping
@Log("删除团购卷类别")
@ApiOperation("删除团购卷类别")
public ResponseEntity<Object> deleteTbCouponCategory(@RequestBody Integer[] ids) {
tbCouponCategoryService.deleteAll(ids);
return new ResponseEntity<>(HttpStatus.OK);
}
}

View File

@@ -43,7 +43,6 @@ public class TbMerchantAccountController {
private final TbMerchantAccountService tbMerchantAccountService;
@Log("导出数据")
@ApiOperation("导出数据")
@GetMapping(value = "/download")
@PreAuthorize("@el.check('tbMerchantAccount:list')")
@@ -52,7 +51,6 @@ public class TbMerchantAccountController {
}
@GetMapping
@Log("查询/merchant/account")
@ApiOperation("查询/merchant/account")
@PreAuthorize("@el.check('tbMerchantAccount:list')")
public ResponseEntity<Object> queryTbMerchantAccount(TbMerchantAccountQueryCriteria criteria, Pageable pageable){
@@ -60,7 +58,6 @@ public class TbMerchantAccountController {
}
@PostMapping
@Log("新增/merchant/account")
@ApiOperation("新增/merchant/account")
@PreAuthorize("@el.check('tbMerchantAccount:add')")
public ResponseEntity<Object> createTbMerchantAccount(@Validated @RequestBody TbMerchantAccount resources){
@@ -68,7 +65,6 @@ public class TbMerchantAccountController {
}
@PutMapping
@Log("修改/merchant/account")
@ApiOperation("修改/merchant/account")
@PreAuthorize("@el.check('tbMerchantAccount:edit')")
public ResponseEntity<Object> updateTbMerchantAccount(@Validated @RequestBody TbMerchantAccount resources){
@@ -77,7 +73,6 @@ public class TbMerchantAccountController {
}
@DeleteMapping
@Log("删除/merchant/account")
@ApiOperation("删除/merchant/account")
@PreAuthorize("@el.check('tbMerchantAccount:del')")
public ResponseEntity<Object> deleteTbMerchantAccount(@RequestBody Integer[] ids) {

View File

@@ -16,9 +16,13 @@
package cn.ysk.cashier.controller.shop;
import cn.ysk.cashier.annotation.Log;
import cn.ysk.cashier.dto.shop.TbMerchantCouponDto;
import cn.ysk.cashier.pojo.shop.TbMerchantCoupon;
import cn.ysk.cashier.pojo.shop.TbPurchaseNotice;
import cn.ysk.cashier.repository.shop.TbPurchaseNoticeRepository;
import cn.ysk.cashier.service.shop.TbMerchantCouponService;
import cn.ysk.cashier.dto.shop.TbMerchantCouponQueryCriteria;
import cn.ysk.cashier.service.shop.TbPurchaseNoticeService;
import org.springframework.data.domain.Pageable;
import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpStatus;
@@ -27,6 +31,8 @@ import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import io.swagger.annotations.*;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import javax.servlet.http.HttpServletResponse;
/**
@@ -41,34 +47,44 @@ import javax.servlet.http.HttpServletResponse;
public class TbMerchantCouponController {
private final TbMerchantCouponService tbMerchantCouponService;
private final TbPurchaseNoticeRepository noticeRepository;
@Log("导出数据")
@ApiOperation("导出数据")
public void exportTbMerchantCoupon(HttpServletResponse response, TbMerchantCouponQueryCriteria criteria) throws IOException {
tbMerchantCouponService.download(tbMerchantCouponService.queryAll(criteria), response);
}
@GetMapping
@Log("查询/shop/coupon")
public ResponseEntity<Object> queryTbMerchantCoupon(TbMerchantCouponQueryCriteria criteria, Pageable pageable){
return new ResponseEntity<>(tbMerchantCouponService.queryAll(criteria,pageable),HttpStatus.OK);
}
@GetMapping("/{id}")
@ApiOperation("查询优惠卷")
public ResponseEntity<Object> queryTbMerchantCouponById(@PathVariable("id")Integer id){
Map result=new HashMap<>();
TbMerchantCouponDto coupon = tbMerchantCouponService.findById(id);
result.put("coupon",coupon);
TbPurchaseNotice notice = noticeRepository.findByCouponId(id);
result.put("notice",notice);
return new ResponseEntity<>(result,HttpStatus.OK);
}
@PostMapping
@Log("新增/shop/coupon")
@Log("新增商家优惠卷:#resources.title")
public ResponseEntity<Object> createTbMerchantCoupon(@Validated @RequestBody TbMerchantCoupon resources){
return new ResponseEntity<>(tbMerchantCouponService.create(resources),HttpStatus.CREATED);
}
@PutMapping
@Log("修改/shop/coupon")
@Log("修改商家优惠卷:#resources.title")
public ResponseEntity<Object> updateTbMerchantCoupon(@Validated @RequestBody TbMerchantCoupon resources){
tbMerchantCouponService.update(resources);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
@DeleteMapping
@Log("删除/shop/coupon")
@Log("删除商家优惠卷:#ids")
public ResponseEntity<Object> deleteTbMerchantCoupon(@RequestBody Integer[] ids) {
tbMerchantCouponService.deleteAll(ids);
return new ResponseEntity<>(HttpStatus.OK);

View File

@@ -50,7 +50,6 @@ public class TbMerchantRegisterController {
// }
@PostMapping("/list")
@Log("查询/shop/register")
@ApiOperation("查询/shop/register")
@PreAuthorize("@el.check('tbMerchantRegister:list')")
public ResponseEntity<Object> queryTbMerchantRegister(@RequestBody TbMerchantRegisterQueryCriteria criteria){
@@ -58,7 +57,6 @@ public class TbMerchantRegisterController {
}
@PostMapping
@Log("新增/shop/register")
@ApiOperation("新增/shop/register")
@PreAuthorize("@el.check('tbMerchantRegister:add')")
public ResponseEntity<Object> createTbMerchantRegister(@Validated @RequestBody TbMerchantRegisterDto resources){
@@ -66,7 +64,6 @@ public class TbMerchantRegisterController {
}
@PutMapping
@Log("修改/shop/register")
@ApiOperation("修改/shop/register")
@PreAuthorize("@el.check('tbMerchantRegister:edit')")
public ResponseEntity<Object> updateTbMerchantRegister(@Validated @RequestBody TbMerchantRegister resources){
@@ -75,7 +72,6 @@ public class TbMerchantRegisterController {
}
@DeleteMapping
@Log("删除/shop/register")
@ApiOperation("删除/shop/register")
@PreAuthorize("@el.check('tbMerchantRegister:del')")
public ResponseEntity<Object> deleteTbMerchantRegister(@RequestBody Integer[] ids) {

View File

@@ -44,7 +44,6 @@ public class TbMerchantThirdApplyController {
private final TbMerchantThirdApplyService tbMerchantThirdApplyService;
@Log("导出数据")
@ApiOperation("导出数据")
@GetMapping(value = "/download")
@PreAuthorize("@el.check('tbMerchantThirdApply:list')")
@@ -53,9 +52,7 @@ public class TbMerchantThirdApplyController {
}
@GetMapping
@Log("查询/shop/thirdApply")
@ApiOperation("查询/shop/thirdApply")
public ResponseEntity<Object> queryTbMerchantThirdApply(TbMerchantThirdApplyQueryCriteria criteria, Pageable pageable){
return new ResponseEntity<>(tbMerchantThirdApplyService.queryAll(criteria,pageable),HttpStatus.OK);
}
@@ -70,7 +67,6 @@ public class TbMerchantThirdApplyController {
}
@PostMapping
@Log("新增/shop/thirdApply")
@ApiOperation("新增/shop/thirdApply")
@PreAuthorize("@el.check('tbMerchantThirdApply:add')")
public ResponseEntity<Object> createTbMerchantThirdApply(@Validated @RequestBody TbMerchantThirdApply resources){
@@ -78,7 +74,6 @@ public class TbMerchantThirdApplyController {
}
@PutMapping
@Log("修改/shop/thirdApply")
@ApiOperation("修改/shop/thirdApply")
@PreAuthorize("@el.check('tbMerchantThirdApply:edit')")
public ResponseEntity<Object> updateTbMerchantThirdApply(@Validated @RequestBody TbMerchantThirdApply resources){
@@ -87,7 +82,6 @@ public class TbMerchantThirdApplyController {
}
@DeleteMapping
@Log("删除/shop/thirdApply")
@ApiOperation("删除/shop/thirdApply")
@PreAuthorize("@el.check('tbMerchantThirdApply:del')")
public ResponseEntity<Object> deleteTbMerchantThirdApply(@RequestBody Integer[] ids) {

View File

@@ -19,6 +19,7 @@ import cn.ysk.cashier.annotation.Log;
import cn.ysk.cashier.pojo.shop.TbPlussShopStaff;
import cn.ysk.cashier.service.shop.TbPlussShopStaffService;
import cn.ysk.cashier.dto.shop.TbPlussShopStaffQueryCriteria;
import io.swagger.models.auth.In;
import org.springframework.data.domain.Pageable;
import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpStatus;
@@ -42,7 +43,6 @@ public class TbPlussShopStaffController {
private final TbPlussShopStaffService tbPlussShopStaffService;
@Log("导出数据")
@ApiOperation("导出数据")
@GetMapping(value = "/download")
public void exportTbPlussShopStaff(HttpServletResponse response, TbPlussShopStaffQueryCriteria criteria) throws IOException {
@@ -50,21 +50,26 @@ public class TbPlussShopStaffController {
}
@GetMapping
@Log("查询/shop/shopStaff")
@ApiOperation("查询/shop/shopStaff")
public ResponseEntity<Object> queryTbPlussShopStaff(TbPlussShopStaffQueryCriteria criteria, Pageable pageable){
return new ResponseEntity<>(tbPlussShopStaffService.queryAll(criteria,pageable),HttpStatus.OK);
}
@GetMapping("/{id}")
@ApiOperation("查询/shop/shopStaff")
public ResponseEntity<Object> queryShopStaffByid(@PathVariable("id") Integer id){
return new ResponseEntity<>(tbPlussShopStaffService.findById(id),HttpStatus.OK);
}
@PostMapping
@Log("新增/shop/shopStaff")
@Log("新增员工:#resources.name")
@ApiOperation("新增/shop/shopStaff")
public ResponseEntity<Object> createTbPlussShopStaff(@Validated @RequestBody TbPlussShopStaff resources){
return new ResponseEntity<>(tbPlussShopStaffService.create(resources),HttpStatus.CREATED);
}
@PutMapping
@Log("修改/shop/shopStaff")
@Log("修改员工:#resources.name")
@ApiOperation("修改/shop/shopStaff")
public ResponseEntity<Object> updateTbPlussShopStaff(@Validated @RequestBody TbPlussShopStaff resources){
tbPlussShopStaffService.update(resources);
@@ -72,7 +77,7 @@ public class TbPlussShopStaffController {
}
@DeleteMapping
@Log("删除/shop/shopStaff")
@Log("删除员工:#ids")
@ApiOperation("删除/shop/shopStaff")
public ResponseEntity<Object> deleteTbPlussShopStaff(@RequestBody Integer[] ids) {
tbPlussShopStaffService.deleteAll(ids);

View File

@@ -48,14 +48,13 @@ public class TbPrintMachineController {
// }
@GetMapping
@Log("查询/shop/print")
@ApiOperation("查询/shop/print")
public ResponseEntity<Object> queryTbPrintMachine(TbPrintMachineQueryCriteria criteria, Pageable pageable){
return new ResponseEntity<>(tbPrintMachineService.queryAll(criteria,pageable),HttpStatus.OK);
}
@PostMapping
@Log("新增/shop/print")
@Log("新增打印机:#resources.name")
@ApiOperation("新增/shop/print")
public ResponseEntity<Object> createTbPrintMachine(@Validated @RequestBody PrintMachineDto resources){
return new ResponseEntity<>(tbPrintMachineService.create(resources),HttpStatus.CREATED);
@@ -66,7 +65,7 @@ public class TbPrintMachineController {
}
@PutMapping
@Log("修改/shop/print")
@Log("修改打印机:#resources.name")
@ApiOperation("修改/shop/print")
public ResponseEntity<Object> updateTbPrintMachine(@Validated @RequestBody PrintMachineDto resources){
tbPrintMachineService.update(resources);
@@ -74,7 +73,7 @@ public class TbPrintMachineController {
}
@DeleteMapping
@Log("删除/shop/print")
@Log("删除打印机:#ids")
@ApiOperation("删除/shop/print")
public ResponseEntity<Object> deleteTbPrintMachine(@RequestBody Integer[] ids) {
tbPrintMachineService.deleteAll(ids);

View File

@@ -0,0 +1,43 @@
package cn.ysk.cashier.controller.shop;
import cn.ysk.cashier.pojo.shop.TbPurchaseNotice;
import cn.ysk.cashier.service.shop.TbPurchaseNoticeService;
import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import io.swagger.annotations.*;
/**
* @author ww
* @date 2024-04-25
**/
@RestController
@RequiredArgsConstructor
@Api(tags = "购买须知/价格说明管理")
@RequestMapping("/api/tbPurchaseNotice")
public class TbPurchaseNoticeController {
private final TbPurchaseNoticeService tbPurchaseNoticeService;
@PostMapping
@ApiOperation("新增购买须知/价格说明")
public ResponseEntity<Object> createTbPurchaseNotice(@Validated @RequestBody TbPurchaseNotice resources){
return new ResponseEntity<>(tbPurchaseNoticeService.create(resources),HttpStatus.CREATED);
}
@PutMapping
@ApiOperation("修改购买须知/价格说明")
public ResponseEntity<Object> updateTbPurchaseNotice(@Validated @RequestBody TbPurchaseNotice resources){
tbPurchaseNoticeService.update(resources);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
@DeleteMapping
@ApiOperation("删除购买须知/价格说明")
public ResponseEntity<Object> deleteTbPurchaseNotice(@RequestBody Integer[] ids) {
tbPurchaseNoticeService.deleteAll(ids);
return new ResponseEntity<>(HttpStatus.OK);
}
}

View File

@@ -43,7 +43,6 @@ public class TbReceiptSalesController {
private final TbReceiptSalesService tbReceiptSalesService;
@Log("导出数据")
@ApiOperation("导出数据")
@GetMapping(value = "/download")
@PreAuthorize("@el.check('tbReceiptSales:list')")
@@ -52,7 +51,6 @@ public class TbReceiptSalesController {
}
@GetMapping
@Log("查询/shop/receiptSales")
@ApiOperation("查询/shop/receiptSales")
@PreAuthorize("@el.check('tbReceiptSales:list')")
public ResponseEntity<Object> queryTbReceiptSales(TbReceiptSalesQueryCriteria criteria, Pageable pageable){
@@ -60,7 +58,6 @@ public class TbReceiptSalesController {
}
@GetMapping("/{shopId}")
@Log("查询/shop/receiptSales")
@ApiOperation("查询/shop/receiptSales")
@PreAuthorize("@el.check('tbReceiptSales:info')")
public Object queryTbReceiptSalesInfo(@PathVariable("shopId")Integer shopId){
@@ -70,7 +67,6 @@ public class TbReceiptSalesController {
@PostMapping
@Log("新增/shop/receiptSales")
@ApiOperation("新增/shop/receiptSales")
@PreAuthorize("@el.check('tbReceiptSales:add')")
public ResponseEntity<Object> createTbReceiptSales(@Validated @RequestBody TbReceiptSales resources){
@@ -78,7 +74,6 @@ public class TbReceiptSalesController {
}
@PutMapping
@Log("修改/shop/receiptSales")
@ApiOperation("修改/shop/receiptSales")
@PreAuthorize("@el.check('tbReceiptSales:edit')")
public ResponseEntity<Object> updateTbReceiptSales(@Validated @RequestBody TbReceiptSales resources){
@@ -87,7 +82,6 @@ public class TbReceiptSalesController {
}
@DeleteMapping
@Log("删除/shop/receiptSales")
@ApiOperation("删除/shop/receiptSales")
@PreAuthorize("@el.check('tbReceiptSales:del')")
public ResponseEntity<Object> deleteTbReceiptSales(@RequestBody Integer[] ids) {

View File

@@ -43,7 +43,6 @@ public class TbShopAreaController {
private final TbShopAreaService tbShopAreaService;
@Log("导出数据")
@ApiOperation("导出数据")
@GetMapping(value = "/download")
@PreAuthorize("@el.check('tbShopArea:list')")
@@ -52,21 +51,20 @@ public class TbShopAreaController {
}
@GetMapping
@Log("查询/shop/area")
@ApiOperation("查询/shop/area")
public ResponseEntity<Object> queryTbShopArea(TbShopAreaQueryCriteria criteria, Pageable pageable){
return new ResponseEntity<>(tbShopAreaService.queryAll(criteria,pageable),HttpStatus.OK);
}
@PostMapping
@Log("新增/shop/area")
@Log("新增区域:#resources.name")
@ApiOperation("新增/shop/area")
public ResponseEntity<Object> createTbShopArea(@Validated @RequestBody TbShopArea resources){
return new ResponseEntity<>(tbShopAreaService.create(resources),HttpStatus.CREATED);
}
@PutMapping
@Log("修改/shop/area")
@Log("修改区域:#resources.name")
@ApiOperation("修改/shop/area")
public ResponseEntity<Object> updateTbShopArea(@Validated @RequestBody TbShopArea resources){
tbShopAreaService.update(resources);
@@ -74,7 +72,7 @@ public class TbShopAreaController {
}
@DeleteMapping
@Log("删除/shop/area")
@Log("删除区域:#ids")
@ApiOperation("删除/shop/area")
public ResponseEntity<Object> deleteTbShopArea(@RequestBody Integer[] ids) {
tbShopAreaService.deleteAll(ids);

View File

@@ -44,7 +44,6 @@ public class TbShopCashSpreadController {
private final TbShopCashSpreadService tbShopCashSpreadService;
@Log("导出数据")
@ApiOperation("导出数据")
@GetMapping(value = "/download")
@PreAuthorize("@el.check('tbShopCashSpread:list')")
@@ -53,14 +52,12 @@ public class TbShopCashSpreadController {
}
@GetMapping
@Log("查询/shop/spread")
@ApiOperation("查询/shop/spread")
@PreAuthorize("@el.check('tbShopCashSpread:list')")
public ResponseEntity<Object> queryTbShopCashSpread(TbShopCashSpreadQueryCriteria criteria, Pageable pageable){
return new ResponseEntity<>(tbShopCashSpreadService.queryAll(criteria,pageable),HttpStatus.OK);
}
@GetMapping("/{shopId}")
@Log("查询/shop/spread/info")
@ApiOperation("查询/shop/spread/info")
@PreAuthorize("@el.check('tbShopCashSpread:info')")
public Object queryTbShopCashSpreadInfo(@PathVariable("shopId") Integer shopId){
@@ -69,7 +66,6 @@ public class TbShopCashSpreadController {
return StringUtils.stringChangeMap(screenConfig);
}
@PostMapping
@Log("新增/shop/spread")
@ApiOperation("新增/shop/spread")
@PreAuthorize("@el.check('tbShopCashSpread:add')")
public ResponseEntity<Object> createTbShopCashSpread(@Validated @RequestBody TbShopCashSpread resources){
@@ -77,7 +73,6 @@ public class TbShopCashSpreadController {
}
@PutMapping
@Log("修改/shop/spread")
@ApiOperation("修改/shop/spread")
@PreAuthorize("@el.check('tbShopCashSpread:edit')")
public ResponseEntity<Object> updateTbShopCashSpread(@Validated @RequestBody TbShopCashSpread resources){
@@ -91,7 +86,6 @@ public class TbShopCashSpreadController {
}
@DeleteMapping
@Log("删除/shop/spread")
@ApiOperation("删除/shop/spread")
@PreAuthorize("@el.check('tbShopCashSpread:del')")
public ResponseEntity<Object> deleteTbShopCashSpread(@RequestBody String[] ids) {

View File

@@ -15,7 +15,6 @@
*/
package cn.ysk.cashier.controller.shop;
import cn.ysk.cashier.annotation.Log;
import cn.ysk.cashier.pojo.shop.TbShopCurrency;
import cn.ysk.cashier.service.shop.TbShopCurrencyService;
import cn.ysk.cashier.dto.shop.TbShopCurrencyQueryCriteria;
@@ -43,7 +42,6 @@ public class TbShopCurrencyController {
private final TbShopCurrencyService tbShopCurrencyService;
@Log("导出数据")
@ApiOperation("导出数据")
@GetMapping(value = "/download")
@PreAuthorize("@el.check('tbShopCurrency:list')")
@@ -52,28 +50,24 @@ public class TbShopCurrencyController {
}
@GetMapping
@Log("查询/shop/currency")
@ApiOperation("查询/shop/currency")
public ResponseEntity<Object> queryTbShopCurrency(TbShopCurrencyQueryCriteria criteria, Pageable pageable){
return new ResponseEntity<>(tbShopCurrencyService.queryAll(criteria,pageable),HttpStatus.OK);
}
@GetMapping("/{shopId}")
@Log("查询/shop/currency/info")
@ApiOperation("查询/shop/currency/info")
public Object queryTbShopCurrencyInfo(@PathVariable("shopId") String shopId){
return tbShopCurrencyService.findByShopId(shopId);
}
@PostMapping
@Log("新增/shop/currency")
@ApiOperation("新增/shop/currency")
public ResponseEntity<Object> createTbShopCurrency(@Validated @RequestBody TbShopCurrency resources){
return new ResponseEntity<>(tbShopCurrencyService.create(resources),HttpStatus.CREATED);
}
@PutMapping
@Log("修改/shop/currency")
@ApiOperation("修改/shop/currency")
public ResponseEntity<Object> updateTbShopCurrency(@Validated @RequestBody TbShopCurrency resources){
tbShopCurrencyService.update(resources);
@@ -81,7 +75,6 @@ public class TbShopCurrencyController {
}
@DeleteMapping
@Log("删除/shop/currency")
@ApiOperation("删除/shop/currency")
public ResponseEntity<Object> deleteTbShopCurrency(@RequestBody Integer[] ids) {
tbShopCurrencyService.deleteAll(ids);

View File

@@ -59,7 +59,6 @@ public class TbShopInfoController {
// }
@GetMapping
@Log("查询/shop/list")
@ApiOperation("查询/shop/list")
@PreAuthorize("@el.check('tbShopInfo:list')")
public ResponseEntity<Object> queryTbShopInfo(TbShopInfoQueryCriteria criteria){
@@ -67,14 +66,13 @@ public class TbShopInfoController {
}
@GetMapping("/{shopId}")
@Log("查询/shop/list")
@ApiOperation("查询/shop/list")
public Object queryInfo(@PathVariable("shopId") Integer shopId){
return tbShopInfoService.findById(shopId);
}
@PostMapping
@Log("新增/shop/list")
@Log("新增商户:#resources.shopName")
@ApiOperation("新增/shop/list")
@PreAuthorize("@el.check('tbShopInfo:add')")
public ResponseEntity<Object> createTbShopInfo(@Validated @RequestBody TbShopInfoDto resources){
@@ -92,7 +90,7 @@ public class TbShopInfoController {
}
@PutMapping
@Log("修改/shop/list")
@Log("修改商户:#resources.shopName")
@ApiOperation("修改/shop/list")
public ResponseEntity<Object> updateTbShopInfo(@Validated @RequestBody TbShopInfo resources){
tbShopInfoService.update(resources);
@@ -100,14 +98,14 @@ public class TbShopInfoController {
}
@PutMapping("/shop")
@Log("修改/shop/list")
@Log("修改商户:#resources.shopName")
public ResponseEntity<Object> updateShopInfoShopId(@Validated @RequestBody TbShopInfo resources){
tbShopInfoService.updateShopId(resources);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
@DeleteMapping
@Log("删除/shop/list")
@Log("删除商户:#ids")
@ApiOperation("删除/shop/list")
@PreAuthorize("@el.check('tbShopInfo:del')")
public ResponseEntity<Object> deleteTbShopInfo(@RequestBody Integer[] ids) {

View File

@@ -43,7 +43,6 @@ public class TbShopPurveyorController {
private final TbShopPurveyorService tbShopPurveyorService;
@Log("导出数据")
@ApiOperation("导出数据")
@GetMapping(value = "/download")
@PreAuthorize("@el.check('tbShopPurveyor:list')")
@@ -52,21 +51,20 @@ public class TbShopPurveyorController {
}
@GetMapping
@Log("查询/shop/purveyor")
@ApiOperation("查询/shop/purveyor")
public ResponseEntity<Object> queryTbShopPurveyor(TbShopPurveyorQueryCriteria criteria, Pageable pageable){
return new ResponseEntity<>(tbShopPurveyorService.queryAll(criteria,pageable),HttpStatus.OK);
}
@PostMapping
@Log("新增/shop/purveyor")
@Log("新增供应商:#resources.name")
@ApiOperation("新增/shop/purveyor")
public ResponseEntity<Object> createTbShopPurveyor(@Validated @RequestBody TbShopPurveyor resources){
return new ResponseEntity<>(tbShopPurveyorService.create(resources),HttpStatus.CREATED);
}
@PutMapping
@Log("修改/shop/purveyor")
@Log("修改供应商:#resources.name")
@ApiOperation("修改/shop/purveyor")
public ResponseEntity<Object> updateTbShopPurveyor(@Validated @RequestBody TbShopPurveyor resources){
tbShopPurveyorService.update(resources);
@@ -74,7 +72,7 @@ public class TbShopPurveyorController {
}
@DeleteMapping
@Log("删除/shop/purveyor")
@Log("删除供应商:#ids")
@ApiOperation("删除/shop/purveyor")
public ResponseEntity<Object> deleteTbShopPurveyor(@RequestBody Integer[] ids) {
tbShopPurveyorService.deleteAll(ids);

View File

@@ -44,7 +44,6 @@ public class TbShopPurveyorTransactController {
private final TbShopPurveyorTransactService tbShopPurveyorTransactService;
@Log("导出数据")
@ApiOperation("导出数据")
@GetMapping(value = "/download")
@PreAuthorize("@el.check('tbShopPurveyorTransact:list')")
@@ -59,7 +58,6 @@ public class TbShopPurveyorTransactController {
* @return
*/
@GetMapping
@Log("查询/shop/purveyorTransact")
@ApiOperation("查询/shop/purveyorTransact")
public ResponseEntity<Object> queryTbShopPurveyorTransactSum(TbShopPurveyorTransactQueryCriteria criteria, Pageable pageable){
return new ResponseEntity<>(tbShopPurveyorTransactService.queryTransactDate(criteria,pageable),HttpStatus.OK);
@@ -71,7 +69,6 @@ public class TbShopPurveyorTransactController {
* @return
*/
@PostMapping("/info")
@Log("查询/shop/purveyorTransact")
public ResponseEntity<Object> queryPurveyorTransact(@RequestBody TbShopPurveyorTransactQueryCriteria criteria){
return new ResponseEntity<>(tbShopPurveyorTransactService.queryPurveyorTransact(criteria),HttpStatus.OK);
}
@@ -87,14 +84,12 @@ public class TbShopPurveyorTransactController {
}
@PostMapping
@Log("新增/shop/purveyorTransact")
@ApiOperation("新增/shop/purveyorTransact")
public ResponseEntity<Object> createTbShopPurveyorTransact(@Validated @RequestBody TbShopPurveyorTransact resources){
return new ResponseEntity<>(tbShopPurveyorTransactService.create(resources),HttpStatus.CREATED);
}
@PutMapping
@Log("修改/shop/purveyorTransact")
@ApiOperation("修改/shop/purveyorTransact")
public ResponseEntity<Object> updateTbShopPurveyorTransact(@Validated @RequestBody TbShopPurveyorTransact resources){
tbShopPurveyorTransactService.update(resources);
@@ -102,7 +97,6 @@ public class TbShopPurveyorTransactController {
}
@DeleteMapping
@Log("删除/shop/purveyorTransact")
@ApiOperation("删除/shop/purveyorTransact")
public ResponseEntity<Object> deleteTbShopPurveyorTransact(@RequestBody Integer[] ids) {
tbShopPurveyorTransactService.deleteAll(ids);

View File

@@ -43,7 +43,6 @@ public class TbShopTableController {
private final TbShopTableService tbShopTableService;
@Log("导出数据")
@ApiOperation("导出数据")
@GetMapping(value = "/download")
@PreAuthorize("@el.check('tbShopTable:list')")
@@ -52,14 +51,13 @@ public class TbShopTableController {
}
@GetMapping
@Log("查询/shop/table")
@ApiOperation("查询/shop/table")
public ResponseEntity<Object> queryTbShopTable(TbShopTableQueryCriteria criteria){
return new ResponseEntity<>(tbShopTableService.queryAllNoPage(criteria),HttpStatus.OK);
}
@PostMapping
@Log("新增/shop/table")
@Log("新增台桌:#resources.name")
@ApiOperation("新增/shop/table")
public ResponseEntity<Object> createTbShopTable(@Validated @RequestBody TbShopTable resources){
return new ResponseEntity<>(tbShopTableService.create(resources),HttpStatus.CREATED);
@@ -72,7 +70,7 @@ public class TbShopTableController {
}
@PutMapping
@Log("修改/shop/table")
@Log("修改台桌:#resources.name")
@ApiOperation("修改/shop/table")
public ResponseEntity<Object> updateTbShopTable(@Validated @RequestBody TbShopTable resources){
tbShopTableService.update(resources);
@@ -80,7 +78,7 @@ public class TbShopTableController {
}
@DeleteMapping
@Log("删除/shop/table")
@Log("删除台桌:#ids")
@ApiOperation("删除/shop/table")
public ResponseEntity<Object> deleteTbShopTable(@RequestBody Integer[] ids) {
tbShopTableService.deleteAll(ids);

View File

@@ -43,7 +43,6 @@ public class TbShopUnitController {
private final TbShopUnitService tbShopUnitService;
@Log("导出数据")
@ApiOperation("导出数据")
@GetMapping(value = "/download")
@PreAuthorize("@el.check('tbShopUnit:list')")
@@ -52,21 +51,20 @@ public class TbShopUnitController {
}
@GetMapping
@Log("查询/shop/unit")
@ApiOperation("查询/shop/unit")
public ResponseEntity<Object> queryTbShopUnit(TbShopUnitQueryCriteria criteria, Pageable pageable){
return new ResponseEntity<>(tbShopUnitService.queryAll(criteria,pageable),HttpStatus.OK);
}
@PostMapping
@Log("新增/shop/unit")
@Log("新增单位:#resources.name")
@ApiOperation("新增/shop/unit")
public ResponseEntity<Object> createTbShopUnit(@Validated @RequestBody TbShopUnit resources)throws Exception{
return new ResponseEntity<>(tbShopUnitService.create(resources),HttpStatus.CREATED);
}
@PutMapping
@Log("修改/shop/unit")
@Log("修改单位:#resources.name")
@ApiOperation("修改/shop/unit")
public ResponseEntity<Object> updateTbShopUnit(@Validated @RequestBody TbShopUnit resources){
tbShopUnitService.update(resources);
@@ -74,7 +72,7 @@ public class TbShopUnitController {
}
@DeleteMapping
@Log("删除/shop/unit")
@Log("删除单位:#ids")
@ApiOperation("删除/shop/unit")
public ResponseEntity<Object> deleteTbShopUnit(@RequestBody Integer[] ids) {
tbShopUnitService.deleteAll(ids);

View File

@@ -42,7 +42,6 @@ public class TbShopUserController {
private final TbShopUserService tbShopUserService;
@Log("导出数据")
@ApiOperation("导出数据")
@GetMapping(value = "/download")
public void exportTbShopUser(HttpServletResponse response, TbShopUserQueryCriteria criteria) throws IOException {
@@ -50,14 +49,12 @@ public class TbShopUserController {
}
@GetMapping
@Log("查询/shop/user")
@ApiOperation("查询/shop/user")
public ResponseEntity<Object> queryTbShopUser(TbShopUserQueryCriteria criteria, Pageable pageable){
return new ResponseEntity<>(tbShopUserService.queryAll(criteria,pageable),HttpStatus.OK);
}
@GetMapping("queryAllShopUser")
@Log("查询商家用户")
@ApiOperation("查询商家用户")
public ResponseEntity<Object> queryAllShopUser(TbShopUserQueryCriteria criteria, Pageable pageable){
return new ResponseEntity<>(tbShopUserService.queryAllShopUser(criteria,pageable),HttpStatus.OK);
@@ -65,14 +62,12 @@ public class TbShopUserController {
@PostMapping
@Log("新增/shop/user")
@ApiOperation("新增/shop/user")
public ResponseEntity<Object> createTbShopUser(@Validated @RequestBody TbShopUser resources){
return new ResponseEntity<>(tbShopUserService.create(resources),HttpStatus.CREATED);
}
@PutMapping
@Log("修改/shop/user")
@ApiOperation("修改/shop/user")
public ResponseEntity<Object> updateTbShopUser(@Validated @RequestBody TbShopUser resources){
tbShopUserService.update(resources);
@@ -80,7 +75,6 @@ public class TbShopUserController {
}
@DeleteMapping
@Log("删除/shop/user")
@ApiOperation("删除/shop/user")
public ResponseEntity<Object> deleteTbShopUser(@RequestBody Integer[] ids) {
tbShopUserService.deleteAll(ids);

View File

@@ -24,31 +24,29 @@ public class TbShopVideoController {
private final TbShopVideoService tbShopVideoService;
@GetMapping
@Log("查询商户视频号")
@ApiOperation("查询商户视频号")
public ResponseEntity<Object> queryTbShopVideo(TbShopVideoQueryCriteria criteria){
criteria.setType(3);
return new ResponseEntity<>(tbShopVideoService.queryAllPage(criteria), HttpStatus.OK);
}
@GetMapping("/{id}")
@ApiOperation("查询商户视频号")
public Object queryInfo(@PathVariable("id") Integer id){
return tbShopVideoService.findById(id);
}
@GetMapping("media")
@Log("查询公众号")
@ApiOperation("查询公众号")
public ResponseEntity<Object> queryMediaPlatform(TbShopVideoQueryCriteria criteria){
criteria.setType(1);
return new ResponseEntity<>(tbShopVideoService.queryAllPage(criteria), HttpStatus.OK);
}
@GetMapping("/{id}")
@Log("查询商户视频号")
@ApiOperation("查询商户视频号")
public Object queryInfo(@PathVariable("id") Integer id){
return tbShopVideoService.findById(id);
}
@PostMapping("media")
@Log("新增公众号")
@Log("新增公众号:#resources.name")
@ApiOperation("新增公众号")
public ResponseEntity<Object> createMediaPlatform(@Validated @RequestBody TbShopVideo resources){
resources.setType(1);
@@ -56,7 +54,7 @@ public class TbShopVideoController {
}
@PostMapping
@Log("新增商户视频号")
@Log("新增商户视频号:#resources.name")
@ApiOperation("新增商户视频号")
public ResponseEntity<Object> createTbShopVideo(@Validated @RequestBody TbShopVideo resources){
resources.setType(3);
@@ -64,16 +62,16 @@ public class TbShopVideoController {
}
@PutMapping
@Log("修改商户视频号")
@ApiOperation("修改商户视频号")
@Log("修改商户视频号:#resources.name")
@ApiOperation("修改商户视频号/公众号管理")
public ResponseEntity<Object> updateTbShopVideo(@Validated @RequestBody TbShopVideo resources){
tbShopVideoService.update(resources);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
@DeleteMapping
@Log("删除商户视频号")
@ApiOperation("删除商户视频号")
@Log("删除商户视频号/公众号管理:#ids")
@ApiOperation("删除资源")
public ResponseEntity<Object> deleteTbShopVideo(@RequestBody Integer[] ids) {
tbShopVideoService.deleteAll(ids);
return new ResponseEntity<>(HttpStatus.OK);

View File

@@ -7,30 +7,36 @@ public class TbPlatformDictDto implements Serializable {
private Integer id;
/** 标签前小图标 */
private String shareImg;
/** 描述 */
private String name;
/** 字体色 */
private String fontColor;
/** 背景色 */
private String backColor;
/** 类型: scan拉起相机relative内部页面absolute外链url */
private String jumpType;
/** 绝对跳转地址 */
private String absUrl;
/** 轮播图;首页小菜单; */
private String type;
/** 封面图 */
private String coverImg;
/** 分享图 */
private String shareImg;
/** 视频URL地址 */
private String video;
/** 视频封面图 */
private String videoCoverImg;
/** 相对跳转地址 */
private String relUrl;
/** 绝对跳转地址 */
private String absUrl;
/** 创建时间 */
private Long createdAt;

View File

@@ -19,6 +19,7 @@ import cn.ysk.cashier.pojo.order.TbOrderDetail;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.persistence.Column;
import java.math.BigDecimal;
import java.io.Serializable;
import java.util.List;
@@ -161,4 +162,10 @@ public class TbOrderInfoDto implements Serializable {
private String payRemark;
private Integer isRefund;
private String tableName;
private String isBuyCoupon;
private String isUseCoupon;
}

View File

@@ -15,9 +15,8 @@
*/
package cn.ysk.cashier.dto.product;
import lombok.Data;
import cn.ysk.cashier.pojo.product.TbProductSku;
import lombok.Data;
import java.math.BigDecimal;
import java.io.Serializable;
import java.util.List;
@@ -213,6 +212,11 @@ public class TbProductDto implements Serializable {
/** 税率 */
private String taxConfigId;
/**
* 团购卷分类Id
*/
List<Integer> groupCategoryId;
/**
* 商品sku信息
*/

View File

@@ -0,0 +1,25 @@
package cn.ysk.cashier.dto.shop;
import lombok.Data;
import java.sql.Timestamp;
import java.io.Serializable;
/**
* @author ww
* @date 2024-04-25
**/
@Data
public class TbCouponCategoryDto implements Serializable {
private Integer id;
/** 分类名称 */
private String name;
private Timestamp createTime;
private Timestamp updateTime;
/** 0不展示1展示 */
private Integer status;
}

View File

@@ -0,0 +1,18 @@
package cn.ysk.cashier.dto.shop;
import lombok.Data;
import java.util.List;
import cn.ysk.cashier.annotation.Query;
/**
* @website https://eladmin.vip
* @author ww
* @date 2024-04-25
**/
@Data
public class TbCouponCategoryQueryCriteria{
@Query(type = Query.Type.INNER_LIKE)
private String name;
}

View File

@@ -123,4 +123,5 @@ public class TbMerchantCouponDto implements Serializable {
/** 商户Id */
private String merchantId;
private String categoryId;
}

View File

@@ -15,6 +15,7 @@
*/
package cn.ysk.cashier.dto.shop;
import cn.ysk.cashier.system.service.dto.UserDto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@@ -57,6 +58,19 @@ public class TbPlussShopStaffDto implements Serializable {
/** shopId */
private String shopId;
/**
* 是否允许管理端端登录
* 0不允许1允许
*/
private Integer isManage;
/**
* 是否允许pc端登录
* 0不允许1允许
*/
private Integer isPc;
private UserDto user;
private Long createdAt;

View File

@@ -29,4 +29,8 @@ public class TbPlussShopStaffQueryCriteria{
/** 精确 */
@Query
private String shopId;
//指定为员工
@Query
private String type="staff";
}

View File

@@ -0,0 +1,48 @@
package cn.ysk.cashier.dto.shop;
import lombok.Data;
import java.io.Serializable;
/**
* @author ww
* @date 2024-04-25
**/
@Data
public class TbPurchaseNoticeDto implements Serializable {
/** 自增 */
private Integer id;
/** 商户卷Id */
private Integer couponId;
/** 使用日期说明 */
private String dateUsed;
/** 可用时间说明 */
private String availableTime;
/** 预约方式 */
private String bookingType;
/** 退款说明 */
private String refundPolicy;
/** 使用规则(富文本) */
private String usageRules;
/** 发票说明 */
private String invoiceInfo;
/** 团购价说明 */
private String groupPurInfo;
/** 门市价/划线价说明 */
private String marketPriceInfo;
/** 折扣说明 */
private String discountInfo;
/** 平台温馨提示 */
private String platformTips;
}

View File

@@ -15,6 +15,7 @@
*/
package cn.ysk.cashier.dto.shop;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.io.Serializable;
@@ -93,6 +94,9 @@ public class TbShopUserDto implements Serializable {
/** 是否股东(分销商) */
private Integer isShareholder;
/** 是否参与优惠券活动 true false */
private String isOpenYhq;
/** 层级1-顶级 2-次级 3最低 */
private Integer level;

View File

@@ -18,9 +18,13 @@ package cn.ysk.cashier.mapper.product;
import cn.ysk.cashier.base.BaseMapper;
import cn.ysk.cashier.pojo.product.TbProduct;
import cn.ysk.cashier.dto.product.TbProductDto;
import cn.ysk.cashier.utils.ListUtil;
import org.mapstruct.Mapper;
import org.mapstruct.ReportingPolicy;
import java.util.List;
import java.util.stream.Collectors;
/**
* @website https://eladmin.vip
* @author lyf
@@ -28,5 +32,18 @@ import org.mapstruct.ReportingPolicy;
**/
@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE)
public interface TbProductMapper extends BaseMapper<TbProductDto, TbProduct> {
default List<Integer> map(String value) {
return ListUtil.stringChangeIntegerList(value);
}
// 如果需要从DTO转回实体也可能需要实现反向的映射方法
default String map(List<Integer> values) {
if (values == null || values.isEmpty()) {
return "";
}
// 将整数列表转换为由逗号分隔的字符串
return values.stream()
.map(String::valueOf)
.collect(Collectors.joining(","));
}
}

View File

@@ -0,0 +1,17 @@
package cn.ysk.cashier.mapper.shop;
//import base.cn.ysk.cashier.BaseMapper;
import cn.ysk.cashier.base.BaseMapper;
import cn.ysk.cashier.dto.shop.TbCouponCategoryDto;
import cn.ysk.cashier.pojo.shop.TbCouponCategory;
import org.mapstruct.Mapper;
import org.mapstruct.ReportingPolicy;
/**
* @author ww
* @date 2024-04-25
**/
@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE)
public interface TbCouponCategoryMapper extends BaseMapper<TbCouponCategoryDto, TbCouponCategory> {
}

View File

@@ -16,7 +16,7 @@
package cn.ysk.cashier.mapper.shop;
import cn.ysk.cashier.base.BaseMapper;
import cn.ysk.cashier.controller.shop.TbPrintMachine;
import cn.ysk.cashier.pojo.shop.TbPrintMachine;
import cn.ysk.cashier.dto.shop.TbPrintMachineDto;
import org.mapstruct.Mapper;
import org.mapstruct.ReportingPolicy;

View File

@@ -0,0 +1,17 @@
package cn.ysk.cashier.mapper.shop;
import cn.ysk.cashier.base.BaseMapper;
import cn.ysk.cashier.dto.shop.TbPurchaseNoticeDto;
import cn.ysk.cashier.pojo.shop.TbPurchaseNotice;
import org.mapstruct.Mapper;
import org.mapstruct.ReportingPolicy;
/**
* @website https://eladmin.vip
* @author ww
* @date 2024-04-25
**/
@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE)
public interface TbPurchaseNoticeMapper extends BaseMapper<TbPurchaseNoticeDto, TbPurchaseNotice> {
}

View File

@@ -58,7 +58,6 @@ public class AppController {
return new ResponseEntity<>(appService.queryAll(criteria,pageable),HttpStatus.OK);
}
@Log("新增应用")
@ApiOperation(value = "新增应用")
@PostMapping
@PreAuthorize("@el.check('app:add')")
@@ -67,7 +66,6 @@ public class AppController {
return new ResponseEntity<>(HttpStatus.CREATED);
}
@Log("修改应用")
@ApiOperation(value = "修改应用")
@PutMapping
@PreAuthorize("@el.check('app:edit')")
@@ -76,7 +74,6 @@ public class AppController {
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
@Log("删除应用")
@ApiOperation(value = "删除应用")
@DeleteMapping
@PreAuthorize("@el.check('app:del')")

View File

@@ -66,7 +66,6 @@ public class DatabaseController {
return new ResponseEntity<>(databaseService.queryAll(criteria,pageable),HttpStatus.OK);
}
@Log("新增数据库")
@ApiOperation(value = "新增数据库")
@PostMapping
@PreAuthorize("@el.check('database:add')")
@@ -75,7 +74,6 @@ public class DatabaseController {
return new ResponseEntity<>(HttpStatus.CREATED);
}
@Log("修改数据库")
@ApiOperation(value = "修改数据库")
@PutMapping
@PreAuthorize("@el.check('database:edit')")
@@ -84,7 +82,6 @@ public class DatabaseController {
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
@Log("删除数据库")
@ApiOperation(value = "删除数据库")
@DeleteMapping
@PreAuthorize("@el.check('database:del')")
@@ -93,7 +90,6 @@ public class DatabaseController {
return new ResponseEntity<>(HttpStatus.OK);
}
@Log("测试数据库链接")
@ApiOperation(value = "测试数据库链接")
@PostMapping("/testConnect")
@PreAuthorize("@el.check('database:testConnect')")
@@ -101,7 +97,6 @@ public class DatabaseController {
return new ResponseEntity<>(databaseService.testConnection(resources),HttpStatus.CREATED);
}
@Log("执行SQL脚本")
@ApiOperation(value = "执行SQL脚本")
@PostMapping(value = "/upload")
@PreAuthorize("@el.check('database:add')")

View File

@@ -68,7 +68,6 @@ public class DeployController {
return new ResponseEntity<>(deployService.queryAll(criteria,pageable),HttpStatus.OK);
}
@Log("新增部署")
@ApiOperation(value = "新增部署")
@PostMapping
@PreAuthorize("@el.check('deploy:add')")
@@ -77,7 +76,6 @@ public class DeployController {
return new ResponseEntity<>(HttpStatus.CREATED);
}
@Log("修改部署")
@ApiOperation(value = "修改部署")
@PutMapping
@PreAuthorize("@el.check('deploy:edit')")
@@ -86,7 +84,6 @@ public class DeployController {
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
@Log("删除部署")
@ApiOperation(value = "删除部署")
@DeleteMapping
@PreAuthorize("@el.check('deploy:del')")
@@ -95,7 +92,6 @@ public class DeployController {
return new ResponseEntity<>(HttpStatus.OK);
}
@Log("上传文件部署")
@ApiOperation(value = "上传文件部署")
@PostMapping(value = "/upload")
@PreAuthorize("@el.check('deploy:edit')")
@@ -118,7 +114,6 @@ public class DeployController {
map.put("id",fileName);
return new ResponseEntity<>(map,HttpStatus.OK);
}
@Log("系统还原")
@ApiOperation(value = "系统还原")
@PostMapping(value = "/serverReduction")
@PreAuthorize("@el.check('deploy:edit')")
@@ -126,7 +121,6 @@ public class DeployController {
String result = deployService.serverReduction(resources);
return new ResponseEntity<>(result,HttpStatus.OK);
}
@Log("服务运行状态")
@ApiOperation(value = "服务运行状态")
@PostMapping(value = "/serverStatus")
@PreAuthorize("@el.check('deploy:edit')")
@@ -134,7 +128,6 @@ public class DeployController {
String result = deployService.serverStatus(resources);
return new ResponseEntity<>(result,HttpStatus.OK);
}
@Log("启动服务")
@ApiOperation(value = "启动服务")
@PostMapping(value = "/startServer")
@PreAuthorize("@el.check('deploy:edit')")
@@ -142,7 +135,6 @@ public class DeployController {
String result = deployService.startServer(resources);
return new ResponseEntity<>(result,HttpStatus.OK);
}
@Log("停止服务")
@ApiOperation(value = "停止服务")
@PostMapping(value = "/stopServer")
@PreAuthorize("@el.check('deploy:edit')")

View File

@@ -56,7 +56,6 @@ public class DeployHistoryController {
return new ResponseEntity<>(deployhistoryService.queryAll(criteria,pageable),HttpStatus.OK);
}
@Log("删除DeployHistory")
@ApiOperation(value = "删除部署历史")
@DeleteMapping
@PreAuthorize("@el.check('deployHistory:del')")

View File

@@ -58,7 +58,6 @@ public class ServerDeployController {
return new ResponseEntity<>(serverDeployService.queryAll(criteria,pageable),HttpStatus.OK);
}
@Log("新增服务器")
@ApiOperation(value = "新增服务器")
@PostMapping
@PreAuthorize("@el.check('serverDeploy:add')")
@@ -67,7 +66,6 @@ public class ServerDeployController {
return new ResponseEntity<>(HttpStatus.CREATED);
}
@Log("修改服务器")
@ApiOperation(value = "修改服务器")
@PutMapping
@PreAuthorize("@el.check('serverDeploy:edit')")
@@ -76,7 +74,6 @@ public class ServerDeployController {
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
@Log("删除服务器")
@ApiOperation(value = "删除Server")
@DeleteMapping
@PreAuthorize("@el.check('serverDeploy:del')")
@@ -85,7 +82,6 @@ public class ServerDeployController {
return new ResponseEntity<>(HttpStatus.OK);
}
@Log("测试连接服务器")
@ApiOperation(value = "测试连接服务器")
@PostMapping("/testConnect")
@PreAuthorize("@el.check('serverDeploy:add')")

View File

@@ -1,4 +1,4 @@
package me.zhengjie.mybatis.entity;
package cn.ysk.cashier.mybatis.entity;
import lombok.Data;

View File

@@ -1,4 +1,4 @@
package me.zhengjie.mybatis.entity;
package cn.ysk.cashier.mybatis.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;

View File

@@ -13,13 +13,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package me.zhengjie.mybatis.mapper;
package cn.ysk.cashier.mybatis.mapper;
import cn.ysk.cashier.pojo.shop.TbMerchantAccount;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import me.zhengjie.modules.shopInfo.merchantAccount.domain.TbMerchantAccount;
import me.zhengjie.mybatis.entity.TbUserStorage;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
/**
* @website https://eladmin.vip

View File

@@ -1,8 +1,7 @@
package me.zhengjie.mybatis.mapper;
package cn.ysk.cashier.mybatis.mapper;
import cn.ysk.cashier.pojo.product.TbProductSku;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import me.zhengjie.modules.productInfo.product.domain.TbProduct;
import me.zhengjie.modules.productInfo.productSku.domain.TbProductSku;
public interface TbProducSkutMapper extends BaseMapper<TbProductSku> {

View File

@@ -1,8 +1,7 @@
package me.zhengjie.mybatis.mapper;
package cn.ysk.cashier.mybatis.mapper;
import cn.ysk.cashier.pojo.product.TbProduct;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import me.zhengjie.modules.productInfo.product.domain.TbProduct;
import me.zhengjie.mybatis.entity.TbUserStorage;
public interface TbProductMapper extends BaseMapper<TbProduct> {

View File

@@ -1,7 +1,7 @@
package me.zhengjie.mybatis.mapper;
package cn.ysk.cashier.mybatis.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import me.zhengjie.mybatis.entity.TbUserStorage;
import cn.ysk.cashier.mybatis.entity.TbUserStorage;
public interface TbUserStorageMapper extends BaseMapper<TbUserStorage> {

View File

@@ -1,11 +1,11 @@
package me.zhengjie.mybatis.rest;
package cn.ysk.cashier.mybatis.rest;
import io.swagger.annotations.Api;
import lombok.RequiredArgsConstructor;
import me.zhengjie.annotation.Log;
import me.zhengjie.mybatis.entity.StorageVo;
import me.zhengjie.mybatis.service.ShopService;
import me.zhengjie.utils.SecurityUtils;
import cn.ysk.cashier.annotation.Log;
import cn.ysk.cashier.mybatis.entity.StorageVo;
import cn.ysk.cashier.mybatis.service.ShopService;
import cn.ysk.cashier.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpStatus;

View File

@@ -13,9 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package me.zhengjie.mybatis.service;
package cn.ysk.cashier.mybatis.service;
import me.zhengjie.mybatis.entity.StorageVo;
import cn.ysk.cashier.mybatis.entity.StorageVo;
import org.springframework.data.domain.Pageable;
/**

View File

@@ -13,22 +13,21 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package me.zhengjie.mybatis.service.impl;
package cn.ysk.cashier.mybatis.service.impl;
import cn.ysk.cashier.pojo.shop.TbMerchantAccount;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import me.zhengjie.exception.NewBadRequestException;
import me.zhengjie.modules.productInfo.productSku.domain.TbProductSku;
import me.zhengjie.modules.shopInfo.merchantAccount.domain.TbMerchantAccount;
import me.zhengjie.mybatis.entity.StorageVo;
import me.zhengjie.mybatis.entity.TbUserStorage;
import me.zhengjie.mybatis.mapper.TbMerchantAccountMapper;
import me.zhengjie.mybatis.mapper.TbProducSkutMapper;
import me.zhengjie.mybatis.mapper.TbProductMapper;
import me.zhengjie.mybatis.mapper.TbUserStorageMapper;
import me.zhengjie.mybatis.service.ShopService;
import me.zhengjie.utils.*;
import cn.ysk.cashier.exception.NewBadRequestException;
import cn.ysk.cashier.mybatis.entity.StorageVo;
import cn.ysk.cashier.mybatis.entity.TbUserStorage;
import cn.ysk.cashier.mybatis.mapper.TbMerchantAccountMapper;
import cn.ysk.cashier.mybatis.mapper.TbProducSkutMapper;
import cn.ysk.cashier.mybatis.mapper.TbProductMapper;
import cn.ysk.cashier.mybatis.mapper.TbUserStorageMapper;
import cn.ysk.cashier.mybatis.service.ShopService;
import cn.ysk.cashier.utils.*;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Pageable;

View File

@@ -18,23 +18,39 @@ public class TbPlatformDict implements Serializable {
@ApiModelProperty(value = "id")
private Integer id;
@Column(name = "`share_img`")
@ApiModelProperty(value = "标签前 小图标")
private String shareImg;
@Column(name = "`name`",nullable = false)
@NotBlank
@ApiModelProperty(value = "描述")
private String name;
@Column(name = "`type`",nullable = false)
@NotBlank
@ApiModelProperty(value = "轮播图;首页小菜单;")
private String type;
@Column(name = "`font_color`")
@ApiModelProperty(value = "字体色")
private String fontColor;
@Column(name = "`back_color`")
@ApiModelProperty(value = "背景色")
private String backColor;
@Column(name = "`jump_type`")
@ApiModelProperty(value = "类型: scan拉起相机relative内部页面absolute外链url ")
private String jumpType;
@Column(name = "`abs_url`")
@ApiModelProperty(value = "绝对跳转地址")
private String absUrl;
@Column(name = "`cover_img`")
@ApiModelProperty(value = "封面图")
private String coverImg;
@Column(name = "`share_img`")
@ApiModelProperty(value = "分享图")
private String shareImg;
@Column(name = "`type`",nullable = false)
@NotBlank
@ApiModelProperty(value = "homeDistrict--金刚区(首页) carousel--轮播图 proTag--商品标签 shopTag店铺标签")
private String type;
@Column(name = "`video`")
@ApiModelProperty(value = "视频URL地址")
@@ -44,13 +60,6 @@ public class TbPlatformDict implements Serializable {
@ApiModelProperty(value = "视频封面图")
private String videoCoverImg;
@Column(name = "`rel_url`")
@ApiModelProperty(value = "相对跳转地址")
private String relUrl;
@Column(name = "`abs_url`")
@ApiModelProperty(value = "绝对跳转地址")
private String absUrl;
@Column(name = "`created_at`")
@ApiModelProperty(value = "创建时间")

View File

@@ -212,6 +212,17 @@ public class TbOrderInfo implements Serializable {
@ApiModelProperty(value = "payRemark")
private String payRemark;
@Column(name = "`table_name`")
@ApiModelProperty(value = "桌码")
private String tableName;
@Column(name = "`is_buy_coupon`")
@ApiModelProperty(value = "是否购买优惠券")
private String isBuyCoupon;
@Column(name = "`is_use_coupon`")
@ApiModelProperty(value = "是否使用优惠券")
private String isUseCoupon;
public void copy(TbOrderInfo source){
BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
}

View File

@@ -311,6 +311,12 @@ public class TbProduct implements Serializable {
@Column(name = "spec_table_headers")
@ApiModelProperty(value = "specTableHeaders")
private String specTableHeaders;
@Column(name = "group_category_id")
@ApiModelProperty(value = "团购卷分类Id")
private String groupCategoryId;
public void copy(TbProduct source){
BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
}

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package me.zhengjie.modules.productInfo.productSku.domain;
package cn.ysk.cashier.pojo.product;
import cn.hutool.json.JSON;
import com.baomidou.mybatisplus.annotation.IdType;

View File

@@ -0,0 +1,46 @@
package cn.ysk.cashier.pojo.shop;
import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;
import javax.persistence.*;
import java.sql.Timestamp;
import java.io.Serializable;
/**
* @website https://eladmin.vip
* @description /
* @author ww
* @date 2024-04-25
**/
@Entity
@Data
@Table(name="tb_coupon_category")
public class TbCouponCategory implements Serializable {
@Id
@Column(name = "`id`")
@ApiModelProperty(value = "id")
private Integer id;
@Column(name = "`name`")
@ApiModelProperty(value = "分类名称")
private String name;
@Column(name = "`create_time`")
@ApiModelProperty(value = "createTime")
private Timestamp createTime;
@Column(name = "`update_time`")
@ApiModelProperty(value = "updateTime")
private Timestamp updateTime;
@Column(name = "`status`")
@ApiModelProperty(value = "0不展示1展示")
private Integer status;
public void copy(TbCouponCategory source){
BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
}
}

View File

@@ -1,24 +1,25 @@
/*
* Copyright 2019-2020 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
* Copyright 2019-2020 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.ysk.cashier.pojo.shop;
import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;
import javax.persistence.*;
import javax.validation.constraints.*;
import java.math.BigDecimal;
@@ -26,13 +27,13 @@ import java.io.Serializable;
import java.sql.Timestamp;
/**
* @website https://eladmin.vip
* @description /
* @author lyf
* @date 2024-03-20
**/
* @author lyf
* @website https://eladmin.vip
* @description /
* @date 2024-03-20
**/
@Entity
@Table(name="tb_merchant_coupon")
@Table(name = "tb_merchant_coupon")
public class TbMerchantCoupon implements Serializable {
@Id
@@ -49,7 +50,7 @@ public class TbMerchantCoupon implements Serializable {
@ApiModelProperty(value = " 优惠券名称")
private String title;
@Column(name = "`template_id`",nullable = false)
@Column(name = "`template_id`", nullable = false)
@NotBlank
@ApiModelProperty(value = "templateId")
private String templateId = "0";
@@ -78,7 +79,11 @@ public class TbMerchantCoupon implements Serializable {
@ApiModelProperty(value = "发放数量")
private Integer number;
@Column(name = "`left_number`",nullable = false)
@Column(name = "`use_number`")
@ApiModelProperty(value = "已核销数量")
private Integer useNumber;
@Column(name = "`left_number`", nullable = false)
@ApiModelProperty(value = "剩余数量")
private Integer leftNumber;
@@ -144,12 +149,12 @@ public class TbMerchantCoupon implements Serializable {
@ApiModelProperty(value = "说明")
private String note;
@Column(name = "`created_at`",nullable = false)
@Column(name = "`created_at`", nullable = false)
@NotNull
@ApiModelProperty(value = "createdAt")
private Long createdAt;
@Column(name = "`updated_at`",nullable = false)
@Column(name = "`updated_at`", nullable = false)
@NotNull
@ApiModelProperty(value = "updatedAt")
private Long updatedAt;
@@ -178,8 +183,12 @@ public class TbMerchantCoupon implements Serializable {
@ApiModelProperty(value = "商户Id")
private String merchantId;
public void copy(TbMerchantCoupon source){
BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
@Column(name = "`category_id`")
@ApiModelProperty(value = "分类id")
private String categoryId;
public void copy(TbMerchantCoupon source) {
BeanUtil.copyProperties(source, this, CopyOptions.create().setIgnoreNullValue(true));
}
public Integer getId() {
@@ -262,6 +271,14 @@ public class TbMerchantCoupon implements Serializable {
this.number = number;
}
public Integer getUseNumber() {
return useNumber;
}
public void setUseNumber(Integer useNumber) {
this.useNumber = useNumber;
}
public Integer getLeftNumber() {
return leftNumber;
}
@@ -453,4 +470,12 @@ public class TbMerchantCoupon implements Serializable {
public void setMerchantId(String merchantId) {
this.merchantId = merchantId;
}
public String getCategoryId() {
return categoryId;
}
public void setCategoryId(String categoryId) {
this.categoryId = categoryId;
}
}

View File

@@ -81,7 +81,22 @@ public class TbPlussShopStaff implements Serializable {
private Long updatedAt;
@Column(name = "type")
@ApiModelProperty(value = "master商户账号staff员工")
private String type;
private String type="staff";
@Column(name = "`is_manage`")
@ApiModelProperty(value = "是否允许管理端登录 0不允许1允许")
private Integer isManage;
@Column(name = "`is_pc`")
@ApiModelProperty(value = "是否允许pc端登录 0不允许1允许")
private Integer isPc;
@Transient
private Long roleId;
@Transient
private String phone;
public void copy(TbPlussShopStaff source){
BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
}

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.ysk.cashier.controller.shop;
package cn.ysk.cashier.pojo.shop;
import lombok.Data;
import cn.hutool.core.bean.BeanUtil;

View File

@@ -0,0 +1,72 @@
package cn.ysk.cashier.pojo.shop;
import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;
import javax.persistence.*;
import java.io.Serializable;
/**
* @author ww
* @date 2024-04-25
**/
@Entity
@Data
@Table(name="tb_purchase_notice")
public class TbPurchaseNotice implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "`id`")
@ApiModelProperty(value = "自增")
private Integer id;
@Column(name = "`coupon_id`")
@ApiModelProperty(value = "商户卷Id")
private Integer couponId;
@Column(name = "`date_used`")
@ApiModelProperty(value = "使用日期说明")
private String dateUsed;
@Column(name = "`available_time`")
@ApiModelProperty(value = "可用时间说明")
private String availableTime;
@Column(name = "`booking_type`")
@ApiModelProperty(value = "预约方式")
private String bookingType;
@Column(name = "`refund_policy`")
@ApiModelProperty(value = "退款说明")
private String refundPolicy;
@Column(name = "`usage_rules`")
@ApiModelProperty(value = "使用规则(富文本)")
private String usageRules;
@Column(name = "`invoice_info`")
@ApiModelProperty(value = "发票说明")
private String invoiceInfo;
@Column(name = "`group_pur_info`")
@ApiModelProperty(value = "团购价说明")
private String groupPurInfo;
@Column(name = "`market_price_Info`")
@ApiModelProperty(value = "门市价/划线价说明")
private String marketPriceInfo;
@Column(name = "`discount_Info`")
@ApiModelProperty(value = "折扣说明")
private String discountInfo;
@Column(name = "`platform_tips`")
@ApiModelProperty(value = "平台温馨提示")
private String platformTips;
public void copy(TbPurchaseNotice source){
BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
}
}

View File

@@ -217,9 +217,8 @@ public class TbShopInfo implements Serializable {
@Column(name = "profiles")
@ApiModelProperty(value = "未激活 no 试用probation 正式release")
private String profiles="";
// @Column(name = "is_open_yhq")
// @ApiModelProperty(value = "是否参与优惠券活动 0否 1是")
@Transient
@Column(name = "is_open_yhq")
@ApiModelProperty(value = "是否参与优惠券活动 true false")
private String isOpenYhq;
@Column(name = "shop_qrcode")

View File

@@ -0,0 +1,13 @@
package cn.ysk.cashier.repository.shop;
import cn.ysk.cashier.pojo.shop.TbCouponCategory;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
/**
* @website https://eladmin.vip
* @author ww
* @date 2024-04-25
**/
public interface TbCouponCategoryRepository extends JpaRepository<TbCouponCategory, Integer>, JpaSpecificationExecutor<TbCouponCategory> {
}

View File

@@ -39,4 +39,7 @@ public interface TbPlussShopStaffRepository extends JpaRepository<TbPlussShopSta
// @Query(value = "update tb_pluss_shop_staff set password = ?2 , updated_at = ?3 where account = ?1",nativeQuery = true)
@Query("update TbPlussShopStaff set password = :password , updatedAt = :lastPasswordResetTime where account = :account")
void updatePass(String account, String password, Long lastPasswordResetTime);
@Query("select staff from TbPlussShopStaff as staff where staff.account = :account")
TbPlussShopStaff queryByAccount(String account);
}

View File

@@ -15,7 +15,7 @@
*/
package cn.ysk.cashier.repository.shop;
import cn.ysk.cashier.controller.shop.TbPrintMachine;
import cn.ysk.cashier.pojo.shop.TbPrintMachine;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

View File

@@ -0,0 +1,21 @@
package cn.ysk.cashier.repository.shop;
import cn.ysk.cashier.pojo.shop.TbPurchaseNotice;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
/**
* @website https://eladmin.vip
* @author ww
* @date 2024-04-25
**/
public interface TbPurchaseNoticeRepository extends JpaRepository<TbPurchaseNotice, Integer>, JpaSpecificationExecutor<TbPurchaseNotice> {
/**
* 根据 couponId 查询
* @param couponId couponId
* @return /
*/
TbPurchaseNotice findByCouponId(Integer couponId);
}

View File

@@ -80,7 +80,7 @@ public class TbVersionServiceImpl implements TbVersionService {
public void update(TbVersion resources) {
TbVersion tbVersion = tbVersionRepository.findById(resources.getId()).orElseGet(TbVersion::new);
ValidationUtil.isNull(tbVersion.getId(), "TbVersion", "id", resources.getId());
redisUtils.del5(tbVersion.getSource() + "_VERSION:" + tbVersion.getType() + ":" + tbVersion.getVersion());
redisUtils.del(tbVersion.getSource() + "_VERSION:" + tbVersion.getType() + ":" + tbVersion.getVersion());
tbVersion.copy(resources);
tbVersion.setUpdatedAt(Instant.now().toEpochMilli());
tbVersionRepository.save(tbVersion);

View File

@@ -303,6 +303,7 @@ public class TbProductServiceImpl implements TbProductService {
//套餐内容
if (!resources.getGroupSnap().isEmpty()) {
product.setGroupSnap(ListUtil.JSONArrayChangeString(resources.getGroupSnap()));
product.setIsCombo(1);
}
TbProduct save = tbProductRepository.save(product);

View File

@@ -13,26 +13,26 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package me.zhengjie.modules.shopInfo.shopRegister.service.impl;
package cn.ysk.cashier.service.impl.shopimpl;
import me.zhengjie.exception.BadRequestException;
import me.zhengjie.modules.shopInfo.shopRegister.domain.TbMerchantRegister;
import me.zhengjie.utils.ValidationUtil;
import me.zhengjie.utils.FileUtil;
import cn.ysk.cashier.dto.shop.TbMerchantRegisterDto;
import cn.ysk.cashier.dto.shop.TbMerchantRegisterQueryCriteria;
import cn.ysk.cashier.exception.BadRequestException;
import cn.ysk.cashier.mapper.shop.TbMerchantRegisterMapper;
import cn.ysk.cashier.pojo.shop.TbMerchantRegister;
import cn.ysk.cashier.repository.shop.TbMerchantRegisterRepository;
import cn.ysk.cashier.service.shop.TbMerchantRegisterService;
import cn.ysk.cashier.utils.ValidationUtil;
import cn.ysk.cashier.utils.FileUtil;
import lombok.RequiredArgsConstructor;
import me.zhengjie.modules.shopInfo.shopRegister.repository.TbMerchantRegisterRepository;
import me.zhengjie.modules.shopInfo.shopRegister.service.TbMerchantRegisterService;
import me.zhengjie.modules.shopInfo.shopRegister.service.dto.TbMerchantRegisterDto;
import me.zhengjie.modules.shopInfo.shopRegister.service.dto.TbMerchantRegisterQueryCriteria;
import me.zhengjie.modules.shopInfo.shopRegister.service.mapstruct.TbMerchantRegisterMapper;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Sort;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import me.zhengjie.utils.PageUtil;
import me.zhengjie.utils.QueryHelp;
import cn.ysk.cashier.utils.PageUtil;
import cn.ysk.cashier.utils.QueryHelp;
import java.time.Instant;
import java.util.*;

View File

@@ -17,6 +17,13 @@ package cn.ysk.cashier.service.impl.shopimpl;
import cn.ysk.cashier.exception.BadRequestException;
import cn.ysk.cashier.pojo.shop.TbPlussShopStaff;
import cn.ysk.cashier.system.domain.Dept;
import cn.ysk.cashier.system.domain.Job;
import cn.ysk.cashier.system.domain.Role;
import cn.ysk.cashier.system.domain.User;
import cn.ysk.cashier.system.repository.UserRepository;
import cn.ysk.cashier.system.service.UserService;
import cn.ysk.cashier.system.service.dto.UserDto;
import cn.ysk.cashier.utils.*;
import lombok.RequiredArgsConstructor;
import cn.ysk.cashier.repository.shop.TbPlussShopStaffRepository;
@@ -24,18 +31,16 @@ import cn.ysk.cashier.service.shop.TbPlussShopStaffService;
import cn.ysk.cashier.dto.shop.TbPlussShopStaffDto;
import cn.ysk.cashier.dto.shop.TbPlussShopStaffQueryCriteria;
import cn.ysk.cashier.mapper.shop.TbPlussShopStaffMapper;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import java.time.Instant;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.LinkedHashMap;
/**
* @website https://eladmin.vip
@@ -50,6 +55,10 @@ public class TbPlussShopStaffServiceImpl implements TbPlussShopStaffService {
private final TbPlussShopStaffRepository tbPlussShopStaffRepository;
private final TbPlussShopStaffMapper tbPlussShopStaffMapper;
private final UserRepository userRepository;
private final PasswordEncoder passwordEncoder;
private final UserService userService;
@Override
public Map<String,Object> queryAll(TbPlussShopStaffQueryCriteria criteria, Pageable pageable){
Page<TbPlussShopStaff> page = tbPlussShopStaffRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable);
@@ -66,7 +75,10 @@ public class TbPlussShopStaffServiceImpl implements TbPlussShopStaffService {
public TbPlussShopStaffDto findById(Integer id) {
TbPlussShopStaff tbPlussShopStaff = tbPlussShopStaffRepository.findById(id).orElseGet(TbPlussShopStaff::new);
ValidationUtil.isNull(tbPlussShopStaff.getId(),"TbPlussShopStaff","id",id);
return tbPlussShopStaffMapper.toDto(tbPlussShopStaff);
TbPlussShopStaffDto dto = tbPlussShopStaffMapper.toDto(tbPlussShopStaff);
UserDto userDto = userService.findByName(tbPlussShopStaff.getAccount());
dto.setUser(userDto);
return dto;
}
@Override
@@ -77,7 +89,31 @@ public class TbPlussShopStaffServiceImpl implements TbPlussShopStaffService {
}
resources.setPassword(MD5Utils.md5("123456"));
resources.setCreatedAt(Instant.now().toEpochMilli());
resources.setUpdatedAt(Instant.now().toEpochMilli());
//添加收银系统后台账号
User user = new User();
user.setPassword(passwordEncoder.encode(resources.getPassword()));
user.setUsername(resources.getAccount());
user.setNickName(resources.getName());
user.setPhone(resources.getPhone());
user.setEnabled(true);
Dept dept = new Dept();
dept.setId(18L);
user.setDept(dept);
Set<Role> roles = new HashSet<>();
Role role = new Role();
role.setId(2L);
roles.add(role);
user.setRoles(roles);
Set<Job> jobs = new HashSet<>();
Job job = new Job();
job.setId(10L);
jobs.add(job);
user.setJobs(jobs);
userRepository.save(user);
return tbPlussShopStaffMapper.toDto(tbPlussShopStaffRepository.save(resources));
}
@@ -85,17 +121,32 @@ public class TbPlussShopStaffServiceImpl implements TbPlussShopStaffService {
@Transactional(rollbackFor = Exception.class)
public void update(TbPlussShopStaff resources) {
TbPlussShopStaff tbPlussShopStaff = tbPlussShopStaffRepository.findById(resources.getId()).orElseGet(TbPlussShopStaff::new);
resources.setUpdatedAt(tbPlussShopStaff.getUpdatedAt());
resources.setUpdatedAt(Instant.now().toEpochMilli());
ValidationUtil.isNull( tbPlussShopStaff.getId(),"TbPlussShopStaff","id",resources.getId());
tbPlussShopStaff.copy(resources);
tbPlussShopStaffRepository.save(tbPlussShopStaff);
//修改 sysUser账号
User sysUser = userRepository.findByUsername(tbPlussShopStaff.getAccount());
Set<Role> roles = new HashSet<>();
Role role = new Role();
role.setId(resources.getRoleId());
roles.add(role);
sysUser.setRoles(roles);
sysUser.setNickName(resources.getName());
sysUser.setPhone(resources.getPhone());
userRepository.save(sysUser);
}
@Override
public void deleteAll(Integer[] ids) {
Set<Long> sysUserIds=new HashSet<>();
for (Integer id : ids) {
TbPlussShopStaff tbPlussShopStaff = tbPlussShopStaffRepository.findById(id).get();
User sysUser = userRepository.findByUsername(tbPlussShopStaff.getAccount());
tbPlussShopStaffRepository.deleteById(id);
sysUserIds.add(sysUser.getId());
}
userService.delete(sysUserIds);
}
@Override

View File

@@ -16,7 +16,7 @@
package cn.ysk.cashier.service.impl.shopimpl;
import cn.ysk.cashier.exception.BadRequestException;
import cn.ysk.cashier.controller.shop.TbPrintMachine;
import cn.ysk.cashier.pojo.shop.TbPrintMachine;
import cn.ysk.cashier.dto.shop.PrintMachineDto;
import cn.ysk.cashier.utils.FileUtil;
import cn.ysk.cashier.utils.ListUtil;

View File

@@ -0,0 +1,85 @@
package cn.ysk.cashier.service.shop;
import cn.ysk.cashier.dto.shop.TbCouponCategoryDto;
import cn.ysk.cashier.dto.shop.TbCouponCategoryQueryCriteria;
import cn.ysk.cashier.mapper.shop.TbCouponCategoryMapper;
import cn.ysk.cashier.pojo.shop.TbCouponCategory;
import cn.ysk.cashier.repository.shop.TbCouponCategoryRepository;
import cn.ysk.cashier.utils.FileUtil;
import cn.ysk.cashier.utils.PageUtil;
import cn.ysk.cashier.utils.QueryHelp;
import cn.ysk.cashier.utils.ValidationUtil;
import lombok.RequiredArgsConstructor;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.data.domain.Pageable;
import java.sql.Timestamp;
import java.util.*;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;
@Service
@RequiredArgsConstructor
public class TbCouponCategoryService {
private final TbCouponCategoryRepository tbCouponCategoryRepository;
private final TbCouponCategoryMapper tbCouponCategoryMapper;
public Map<String,Object> queryAll(TbCouponCategoryQueryCriteria criteria, Pageable pageable){
Page<TbCouponCategory> page = tbCouponCategoryRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable);
return PageUtil.toPage(page.map(tbCouponCategoryMapper::toDto));
}
public List<TbCouponCategoryDto> queryAll(TbCouponCategoryQueryCriteria criteria){
return tbCouponCategoryMapper.toDto(tbCouponCategoryRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder)));
}
@Transactional
public TbCouponCategoryDto findById(Integer id) {
TbCouponCategory tbCouponCategory = tbCouponCategoryRepository.findById(id).orElseGet(TbCouponCategory::new);
ValidationUtil.isNull(tbCouponCategory.getId(),"TbCouponCategory","id",id);
return tbCouponCategoryMapper.toDto(tbCouponCategory);
}
@Transactional(rollbackFor = Exception.class)
public TbCouponCategoryDto create(TbCouponCategory resources) {
resources.setCreateTime(new Timestamp(System.currentTimeMillis()));
return tbCouponCategoryMapper.toDto(tbCouponCategoryRepository.save(resources));
}
@Transactional(rollbackFor = Exception.class)
public void update(TbCouponCategory resources) {
TbCouponCategory tbCouponCategory = tbCouponCategoryRepository.findById(resources.getId()).orElseGet(TbCouponCategory::new);
ValidationUtil.isNull( tbCouponCategory.getId(),"TbCouponCategory","id",resources.getId());
tbCouponCategory.copy(resources);
tbCouponCategory.setUpdateTime(new Timestamp(System.currentTimeMillis()));
tbCouponCategoryRepository.save(tbCouponCategory);
}
public void deleteAll(Integer[] ids) {
for (Integer id : ids) {
tbCouponCategoryRepository.deleteById(id);
}
}
public void download(List<TbCouponCategoryDto> all, HttpServletResponse response) throws IOException {
List<Map<String, Object>> list = new ArrayList<>();
for (TbCouponCategoryDto tbCouponCategory : all) {
Map<String,Object> map = new LinkedHashMap<>();
map.put("分类名称", tbCouponCategory.getName());
map.put(" createTime", tbCouponCategory.getCreateTime());
map.put(" updateTime", tbCouponCategory.getUpdateTime());
map.put("0不展示1展示", tbCouponCategory.getStatus());
list.add(map);
}
FileUtil.downloadExcel(list, response);
}
}

View File

@@ -15,7 +15,7 @@
*/
package cn.ysk.cashier.service.shop;
import cn.ysk.cashier.controller.shop.TbPrintMachine;
import cn.ysk.cashier.pojo.shop.TbPrintMachine;
import cn.ysk.cashier.dto.shop.PrintMachineDto;
import cn.ysk.cashier.dto.shop.TbPrintMachineDto;
import cn.ysk.cashier.dto.shop.TbPrintMachineQueryCriteria;

View File

@@ -0,0 +1,39 @@
package cn.ysk.cashier.service.shop;
import cn.ysk.cashier.dto.shop.TbPurchaseNoticeDto;
import cn.ysk.cashier.mapper.shop.TbPurchaseNoticeMapper;
import cn.ysk.cashier.pojo.shop.TbPurchaseNotice;
import cn.ysk.cashier.repository.shop.TbPurchaseNoticeRepository;
import cn.ysk.cashier.utils.ValidationUtil;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@Service
@RequiredArgsConstructor
public class TbPurchaseNoticeService{
private final TbPurchaseNoticeRepository tbPurchaseNoticeRepository;
private final TbPurchaseNoticeMapper tbPurchaseNoticeMapper;
@Transactional(rollbackFor = Exception.class)
public TbPurchaseNoticeDto create(TbPurchaseNotice resources) {
return tbPurchaseNoticeMapper.toDto(tbPurchaseNoticeRepository.save(resources));
}
@Transactional(rollbackFor = Exception.class)
public void update(TbPurchaseNotice resources) {
TbPurchaseNotice tbPurchaseNotice = tbPurchaseNoticeRepository.findById(resources.getId()).orElseGet(TbPurchaseNotice::new);
ValidationUtil.isNull( tbPurchaseNotice.getId(),"TbPurchaseNotice","id",resources.getId());
tbPurchaseNotice.copy(resources);
tbPurchaseNoticeRepository.save(tbPurchaseNotice);
}
public void deleteAll(Integer[] ids) {
for (Integer id : ids) {
tbPurchaseNoticeRepository.deleteById(id);
}
}
}

View File

@@ -56,6 +56,9 @@ public class Dict extends BaseEntity implements Serializable {
@ApiModelProperty(value = "描述")
private String description;
@ApiModelProperty(value = "类型:通用-common首页-home热销-hot")
private String type;
@Column(name = "is_child")
@ApiModelProperty(value = "描述 是否有子类0否1是")
private Integer isChild;

View File

@@ -93,6 +93,11 @@ public class Menu extends BaseEntity implements Serializable {
@ApiModelProperty(value = "是否选中父级菜单")
private String activeMenu;
@Column(name = "is_shop")
@ApiModelProperty(value = "商户使用 01")
private Integer isShop;
@Override
public boolean equals(Object o) {
if (this == o) {

Some files were not shown because too many files have changed in this diff Show More