新增订单模块
This commit is contained in:
@@ -62,12 +62,37 @@
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-data-redis</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!--weixin-java-common-->
|
||||
<dependency>
|
||||
<groupId>com.starry</groupId>
|
||||
<artifactId>play-weichat</artifactId>
|
||||
<version>1.0</version>
|
||||
<scope>compile</scope>
|
||||
<groupId>com.github.binarywang</groupId>
|
||||
<artifactId>weixin-java-common</artifactId>
|
||||
</dependency>
|
||||
<!--weixin-java-admin-->
|
||||
<dependency>
|
||||
<groupId>com.github.binarywang</groupId>
|
||||
<artifactId>weixin-java-mp</artifactId>
|
||||
</dependency>
|
||||
<!--weixin-java-miniapp-->
|
||||
<dependency>
|
||||
<groupId>com.github.binarywang</groupId>
|
||||
<artifactId>weixin-java-miniapp</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!--weixin-java-pay-->
|
||||
<dependency>
|
||||
<groupId>com.github.binarywang</groupId>
|
||||
<artifactId>weixin-java-pay</artifactId>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<artifactId>guava</artifactId>
|
||||
<groupId>com.google.guava</groupId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
|
||||
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
@@ -6,7 +6,7 @@ import com.starry.admin.modules.system.entity.SysRoleEntity;
|
||||
import com.starry.admin.modules.system.entity.SysUserEntity;
|
||||
import com.starry.admin.utils.SecurityUtils;
|
||||
import com.starry.common.annotation.DataScope;
|
||||
import com.starry.common.context.SecurityContextHolder;
|
||||
import com.starry.common.context.CustomSecurityContextHolder;
|
||||
import com.starry.common.domain.BaseEntity;
|
||||
import com.starry.common.utils.StringUtils;
|
||||
import org.aspectj.lang.JoinPoint;
|
||||
@@ -125,7 +125,7 @@ public class DataScopeAspect {
|
||||
SysUserEntity currentUser = loginUser.getUser();
|
||||
// 如果是超级管理员,则不过滤数据
|
||||
if (StringUtils.isNotNull(currentUser) && !currentUser.isAdmin()) {
|
||||
String permission = StringUtils.defaultIfEmpty(controllerDataScope.permission(), SecurityContextHolder.getPermission());
|
||||
String permission = StringUtils.defaultIfEmpty(controllerDataScope.permission(), CustomSecurityContextHolder.getPermission());
|
||||
dataScopeFilter(joinPoint, currentUser, controllerDataScope.deptAlias(),
|
||||
controllerDataScope.userAlias(), permission);
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import com.starry.admin.common.security.entity.JwtUser;
|
||||
import com.starry.common.constant.CacheConstants;
|
||||
import com.starry.common.constant.Constants;
|
||||
import com.starry.common.constant.SecurityConstants;
|
||||
import com.starry.common.context.CustomSecurityContextHolder;
|
||||
import com.starry.common.redis.RedisCache;
|
||||
import com.starry.common.utils.ServletUtils;
|
||||
import com.starry.common.utils.StringUtils;
|
||||
@@ -312,8 +313,8 @@ public class JwtToken {
|
||||
String uuid = (String) claims.get(SecurityConstants.USER_KEY);
|
||||
String userKey = getTokenKey(uuid);
|
||||
LoginUser loginUser = redisCache.getCacheObject(userKey);
|
||||
com.starry.common.context.SecurityContextHolder.set(SecurityConstants.DETAILS_TENANT_ID, loginUser.getUser().getTenantId());
|
||||
com.starry.common.context.SecurityContextHolder.set(SecurityConstants.LOGIN_USER, loginUser);
|
||||
CustomSecurityContextHolder.set(SecurityConstants.DETAILS_TENANT_ID, loginUser.getUser().getTenantId());
|
||||
CustomSecurityContextHolder.set(SecurityConstants.LOGIN_USER, loginUser);
|
||||
return loginUser;
|
||||
} catch (Exception e) {
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ public class PermissionService {
|
||||
*/
|
||||
private static final String SUPER_ADMIN = "admin";
|
||||
|
||||
private static final String ROLE_DELIMETER = ",";
|
||||
private static final String ROLE_DELIMITER = ",";
|
||||
|
||||
private static final String PERMISSION_DELIMETER = ",";
|
||||
|
||||
@@ -37,7 +37,7 @@ public class PermissionService {
|
||||
* @param permission 权限字符串
|
||||
* @return 用户是否具备某权限
|
||||
*/
|
||||
public boolean hasPermi(String permission) {
|
||||
public boolean hasPermission(String permission) {
|
||||
if (StringUtils.isEmpty(permission)) {
|
||||
return false;
|
||||
}
|
||||
@@ -49,13 +49,13 @@ public class PermissionService {
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证用户是否不具备某权限,与 hasPermi逻辑相反
|
||||
* 验证用户是否不具备某权限,与 hasPermission逻辑相反
|
||||
*
|
||||
* @param permission 权限字符串
|
||||
* @return 用户是否不具备某权限
|
||||
*/
|
||||
public boolean lacksPermi(String permission) {
|
||||
return hasPermi(permission) != true;
|
||||
public boolean lacksPermission(String permission) {
|
||||
return hasPermission(permission) != true;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -64,7 +64,7 @@ public class PermissionService {
|
||||
* @param permissions 以 PERMISSION_NAMES_DELIMETER 为分隔符的权限列表
|
||||
* @return 用户是否具有以下任意一个权限
|
||||
*/
|
||||
public boolean hasAnyPermi(String permissions) {
|
||||
public boolean hasAnyPermission(String permissions) {
|
||||
if (StringUtils.isEmpty(permissions)) {
|
||||
return false;
|
||||
}
|
||||
@@ -111,13 +111,13 @@ public class PermissionService {
|
||||
* @return 用户是否不具备某角色
|
||||
*/
|
||||
public boolean lacksRole(String role) {
|
||||
return hasRole(role) != true;
|
||||
return !hasRole(role);
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证用户是否具有以下任意一个角色
|
||||
*
|
||||
* @param roles 以 ROLE_NAMES_DELIMETER 为分隔符的角色列表
|
||||
* @param roles 以 ROLE_NAMES_DELIMITER 为分隔符的角色列表
|
||||
* @return 用户是否具有以下任意一个角色
|
||||
*/
|
||||
public boolean hasAnyRoles(String roles) {
|
||||
@@ -128,7 +128,7 @@ public class PermissionService {
|
||||
if (loginUser == null || CollectionUtils.isEmpty(loginUser.getUser().getRoles())) {
|
||||
return false;
|
||||
}
|
||||
for (String role : roles.split(ROLE_DELIMETER)) {
|
||||
for (String role : roles.split(ROLE_DELIMITER)) {
|
||||
if (hasRole(role)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.starry.admin.common.mybatis.handler;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.extension.plugins.handler.TenantLineHandler;
|
||||
import com.starry.admin.utils.SecurityUtils;
|
||||
import com.starry.common.utils.StringUtils;
|
||||
@@ -33,8 +34,8 @@ public class MyTenantLineHandler implements TenantLineHandler {
|
||||
@Override
|
||||
public Expression getTenantId() {
|
||||
// 取出当前请求的服务商ID,通过解析器注入到SQL中。
|
||||
Long tenantId = SecurityUtils.getTenantId();
|
||||
if (tenantId == null) {
|
||||
String tenantId = SecurityUtils.getTenantId();
|
||||
if (StrUtil.isBlankIfStr(tenantId)) {
|
||||
return new NullValue();
|
||||
}
|
||||
return new LongValue(tenantId);
|
||||
|
||||
@@ -0,0 +1,85 @@
|
||||
package com.starry.admin.modules.commodity.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.starry.admin.modules.commodity.module.entity.CommodityInfoEntity;
|
||||
import com.starry.admin.modules.commodity.service.ICommodityInfoService;
|
||||
import com.starry.common.annotation.Log;
|
||||
import com.starry.common.enums.BusinessType;
|
||||
import com.starry.common.result.R;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
|
||||
/**
|
||||
* 商品Controller
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-03-22
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/commodity/info")
|
||||
public class CommodityInfoController {
|
||||
@Resource
|
||||
private ICommodityInfoService commodityInfoService;
|
||||
|
||||
/**
|
||||
* 查询商品列表
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermission('commodity:info:list')")
|
||||
@GetMapping("/list")
|
||||
public R list(CommodityInfoEntity commodityInfo) {
|
||||
IPage<CommodityInfoEntity> list = commodityInfoService.selectCommodityInfoByPage(commodityInfo);
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取商品详细信息
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermission('commodity:info:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public R getInfo(@PathVariable("id") String id) {
|
||||
return R.ok(commodityInfoService.selectCommodityInfoEntityById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增商品
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermission('commodity:info:create')")
|
||||
@Log(title = "商品", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/create")
|
||||
public R create(@RequestBody CommodityInfoEntity commodityInfo) {
|
||||
boolean success = commodityInfoService.create(commodityInfo);
|
||||
if (success) {
|
||||
return R.ok();
|
||||
}
|
||||
return R.error("添加失败");
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改商品
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermission('commodity:info:edit')")
|
||||
@Log(title = "商品", businessType = BusinessType.UPDATE)
|
||||
@PostMapping(value = "/update/{id}")
|
||||
public R update(@PathVariable String id, @RequestBody CommodityInfoEntity commodityInfo) {
|
||||
commodityInfo.setId(id);
|
||||
boolean success = commodityInfoService.update(commodityInfo);
|
||||
if (success) {
|
||||
return R.ok();
|
||||
}
|
||||
return R.error("修改失败");
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商品
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermission('commodity:info:remove')")
|
||||
@Log(title = "商品", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R remove(@PathVariable String[] ids) {
|
||||
return R.ok(commodityInfoService.deleteCommodityInfoEntityByIds(ids));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.starry.admin.modules.commodity.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.starry.admin.modules.commodity.module.entity.CommodityInfoEntity;
|
||||
|
||||
|
||||
/**
|
||||
* 商品Mapper接口
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-03-22
|
||||
*/
|
||||
public interface CommodityInfoMapper extends BaseMapper<CommodityInfoEntity> {
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.starry.admin.modules.commodity.module.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.starry.common.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("commodity_info")
|
||||
public class CommodityInfoEntity extends BaseEntity<CommodityInfoEntity> {
|
||||
|
||||
/**
|
||||
* UUID
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 价格
|
||||
*/
|
||||
private String money;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package com.starry.admin.modules.commodity.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.starry.admin.modules.commodity.module.entity.CommodityInfoEntity;
|
||||
|
||||
|
||||
/**
|
||||
* 商品Service接口
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-03-22
|
||||
*/
|
||||
public interface ICommodityInfoService extends IService<CommodityInfoEntity> {
|
||||
/**
|
||||
* 查询商品
|
||||
*
|
||||
* @param id 商品主键
|
||||
* @return 商品
|
||||
*/
|
||||
CommodityInfoEntity selectCommodityInfoEntityById(String id);
|
||||
|
||||
/**
|
||||
* 查询商品列表
|
||||
*
|
||||
* @param CommodityInfoEntity 商品
|
||||
* @return 商品集合
|
||||
*/
|
||||
IPage<CommodityInfoEntity> selectCommodityInfoByPage(CommodityInfoEntity CommodityInfoEntity);
|
||||
|
||||
/**
|
||||
* 新增商品
|
||||
*
|
||||
* @param CommodityInfoEntity 商品
|
||||
* @return 结果
|
||||
*/
|
||||
boolean create(CommodityInfoEntity CommodityInfoEntity);
|
||||
|
||||
/**
|
||||
* 修改商品
|
||||
*
|
||||
* @param CommodityInfoEntity 商品
|
||||
* @return 结果
|
||||
*/
|
||||
boolean update(CommodityInfoEntity CommodityInfoEntity);
|
||||
|
||||
/**
|
||||
* 批量删除商品
|
||||
*
|
||||
* @param ids 需要删除的商品主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteCommodityInfoEntityByIds(String[] ids);
|
||||
|
||||
/**
|
||||
* 删除商品信息
|
||||
*
|
||||
* @param id 商品主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteCommodityInfoEntityById(String id);
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
package com.starry.admin.modules.commodity.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.starry.admin.modules.commodity.mapper.CommodityInfoMapper;
|
||||
import com.starry.admin.modules.commodity.module.entity.CommodityInfoEntity;
|
||||
import com.starry.admin.modules.commodity.service.ICommodityInfoService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* 商品Service业务层处理
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-03-22
|
||||
*/
|
||||
@Service
|
||||
public class CommodityInfoServiceImpl extends ServiceImpl<CommodityInfoMapper, CommodityInfoEntity> implements ICommodityInfoService {
|
||||
@Resource
|
||||
private CommodityInfoMapper CommodityInfoMapper;
|
||||
|
||||
/**
|
||||
* 查询商品
|
||||
*
|
||||
* @param id 商品主键
|
||||
* @return 商品
|
||||
*/
|
||||
@Override
|
||||
public CommodityInfoEntity selectCommodityInfoEntityById(String id) {
|
||||
return this.baseMapper.selectById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询商品列表
|
||||
*
|
||||
* @param CommodityInfoEntity 商品
|
||||
* @return 商品
|
||||
*/
|
||||
@Override
|
||||
public IPage<CommodityInfoEntity> selectCommodityInfoByPage(CommodityInfoEntity CommodityInfoEntity) {
|
||||
Page<CommodityInfoEntity> page = new Page<>(1, 10);
|
||||
return this.baseMapper.selectPage(page, new LambdaQueryWrapper<CommodityInfoEntity>());
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增商品
|
||||
*
|
||||
* @param CommodityInfoEntity 商品
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public boolean create(CommodityInfoEntity CommodityInfoEntity) {
|
||||
return save(CommodityInfoEntity);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改商品
|
||||
*
|
||||
* @param CommodityInfoEntity 商品
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public boolean update(CommodityInfoEntity CommodityInfoEntity) {
|
||||
return updateById(CommodityInfoEntity);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除商品
|
||||
*
|
||||
* @param ids 需要删除的商品主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteCommodityInfoEntityByIds(String[] ids) {
|
||||
return CommodityInfoMapper.deleteBatchIds(Arrays.asList(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商品信息
|
||||
*
|
||||
* @param id 商品主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteCommodityInfoEntityById(String id) {
|
||||
return CommodityInfoMapper.deleteById(id);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
package com.starry.admin.modules.coupon.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.starry.admin.modules.coupon.module.entity.CouponInfoEntity;
|
||||
import com.starry.admin.modules.coupon.service.ICouponInfoService;
|
||||
import com.starry.common.annotation.Log;
|
||||
import com.starry.common.enums.BusinessType;
|
||||
import com.starry.common.result.R;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 商品Controller
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-03-22
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/coupon/info")
|
||||
public class CouponInfoController {
|
||||
@Resource
|
||||
private ICouponInfoService couponInfoService;
|
||||
|
||||
/**
|
||||
* 查询商品列表
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermission('coupon/infolist')")
|
||||
@GetMapping("/list")
|
||||
public R list(CouponInfoEntity couponInfo) {
|
||||
|
||||
IPage<CouponInfoEntity> list = couponInfoService.selectCouponInfoByPage(couponInfo);
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取商品详细信息
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermission('coupon/infoquery')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public R getInfo(@PathVariable("id") String id) {
|
||||
return R.ok(couponInfoService.selectCouponInfoById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增商品
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermission('coupon/infocreate')")
|
||||
@Log(title = "商品", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/create")
|
||||
public R create(@RequestBody CouponInfoEntity couponInfo) {
|
||||
boolean success = couponInfoService.create(couponInfo);
|
||||
if (success) {
|
||||
return R.ok();
|
||||
}
|
||||
return R.error("添加失败");
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改商品
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermission('coupon/infoedit')")
|
||||
@Log(title = "商品", businessType = BusinessType.UPDATE)
|
||||
@PostMapping(value = "/update/{id}")
|
||||
public R update(@PathVariable String id, @RequestBody CouponInfoEntity couponInfo) {
|
||||
couponInfo.setId(id);
|
||||
boolean success = couponInfoService.update(couponInfo);
|
||||
if (success) {
|
||||
return R.ok();
|
||||
}
|
||||
return R.error("修改失败");
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商品
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermission('coupon/inforemove')")
|
||||
@Log(title = "商品", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R remove(@PathVariable String[] ids) {
|
||||
return R.ok(couponInfoService.deleteCouponInfoByIds(ids));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.starry.admin.modules.coupon.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.starry.admin.modules.coupon.module.entity.CouponInfoEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商品Mapper接口
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-03-22
|
||||
*/
|
||||
public interface CouponInfoMapper extends BaseMapper<CouponInfoEntity> {
|
||||
/**
|
||||
* 查询商品
|
||||
* @param id 商品主键
|
||||
* @return 商品
|
||||
*/
|
||||
CouponInfoEntity selectCouponInfoById(String id);
|
||||
|
||||
/**
|
||||
* 查询商品列表
|
||||
* @param couponInfo 商品
|
||||
* @return 商品集合
|
||||
*/
|
||||
List<CouponInfoEntity> selectCouponInfoList(CouponInfoEntity couponInfo);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.starry.admin.modules.coupon.module.entity;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.starry.common.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("coupon_info")
|
||||
public class CouponInfoEntity extends BaseEntity<CouponInfoEntity> {
|
||||
|
||||
/**
|
||||
* UUID
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 价格
|
||||
*/
|
||||
private String money;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.starry.admin.modules.coupon.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.starry.admin.modules.coupon.module.entity.CouponInfoEntity;
|
||||
|
||||
/**
|
||||
* 商品Service接口
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-03-22
|
||||
*/
|
||||
public interface ICouponInfoService extends IService<CouponInfoEntity> {
|
||||
/**
|
||||
* 查询商品
|
||||
*
|
||||
* @param id 商品主键
|
||||
* @return 商品
|
||||
*/
|
||||
CouponInfoEntity selectCouponInfoById(String id);
|
||||
|
||||
/**
|
||||
* 查询商品列表
|
||||
*
|
||||
* @param couponInfo 商品
|
||||
* @return 商品集合
|
||||
*/
|
||||
IPage<CouponInfoEntity> selectCouponInfoByPage(CouponInfoEntity couponInfo);
|
||||
|
||||
/**
|
||||
* 新增商品
|
||||
*
|
||||
* @param couponInfo 商品
|
||||
* @return 结果
|
||||
*/
|
||||
boolean create(CouponInfoEntity couponInfo);
|
||||
|
||||
/**
|
||||
* 修改商品
|
||||
*
|
||||
* @param couponInfo 商品
|
||||
* @return 结果
|
||||
*/
|
||||
boolean update(CouponInfoEntity couponInfo);
|
||||
|
||||
/**
|
||||
* 批量删除商品
|
||||
*
|
||||
* @param ids 需要删除的商品主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteCouponInfoByIds(String[] ids);
|
||||
|
||||
/**
|
||||
* 删除商品信息
|
||||
*
|
||||
* @param id 商品主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteCouponInfoById(String id);
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
package com.starry.admin.modules.coupon.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.starry.admin.modules.coupon.mapper.CouponInfoMapper;
|
||||
import com.starry.admin.modules.coupon.module.entity.CouponInfoEntity;
|
||||
import com.starry.admin.modules.coupon.service.ICouponInfoService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* 商品Service业务层处理
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-03-22
|
||||
*/
|
||||
@Service
|
||||
public class CouponInfoServiceImpl extends ServiceImpl<CouponInfoMapper, CouponInfoEntity> implements ICouponInfoService {
|
||||
@Resource
|
||||
private CouponInfoMapper couponInfoMapper;
|
||||
|
||||
/**
|
||||
* 查询商品
|
||||
* @param id 商品主键
|
||||
* @return 商品
|
||||
*/
|
||||
@Override
|
||||
public CouponInfoEntity selectCouponInfoById(String id) {
|
||||
return this.baseMapper.selectById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询商品列表
|
||||
* @param couponInfo 商品
|
||||
* @return 商品
|
||||
*/
|
||||
@Override
|
||||
public IPage<CouponInfoEntity> selectCouponInfoByPage(CouponInfoEntity couponInfo) {
|
||||
Page<CouponInfoEntity> page = new Page<>(1, 10);
|
||||
return this.baseMapper.selectPage(page, new LambdaQueryWrapper<CouponInfoEntity>());
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增商品
|
||||
* @param couponInfo 商品
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public boolean create(CouponInfoEntity couponInfo) {
|
||||
return save(couponInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改商品
|
||||
* @param couponInfo 商品
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public boolean update(CouponInfoEntity couponInfo) {
|
||||
return updateById(couponInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除商品
|
||||
* @param ids 需要删除的商品主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteCouponInfoByIds(String[] ids) {
|
||||
return couponInfoMapper.deleteBatchIds(Arrays.asList(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商品信息
|
||||
* @param id 商品主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteCouponInfoById(String id) {
|
||||
return couponInfoMapper.deleteById(id);
|
||||
}
|
||||
}
|
||||
@@ -33,7 +33,7 @@ public class CacheController {
|
||||
CACHES.add(new Cache(CacheConstants.CAPTCHA_CODE_KEY, "验证码"));
|
||||
}
|
||||
|
||||
@PreAuthorize("@customSs.hasPermi('monitor:cache:list')")
|
||||
@PreAuthorize("@customSs.hasPermission('monitor:cache:list')")
|
||||
@GetMapping()
|
||||
public R getInfo() throws Exception {
|
||||
Properties info = (Properties) redisTemplate.execute((RedisCallback<Object>) RedisServerCommands::info);
|
||||
@@ -55,20 +55,20 @@ public class CacheController {
|
||||
return R.ok(result);
|
||||
}
|
||||
|
||||
@PreAuthorize("@customSs.hasPermi('monitor:cache:list')")
|
||||
@PreAuthorize("@customSs.hasPermission('monitor:cache:list')")
|
||||
@GetMapping("/getNames")
|
||||
public R cache() {
|
||||
return R.ok(CACHES);
|
||||
}
|
||||
|
||||
@PreAuthorize("@customSs.hasPermi('monitor:cache:list')")
|
||||
@PreAuthorize("@customSs.hasPermission('monitor:cache:list')")
|
||||
@GetMapping("/getKeys/{cacheName}")
|
||||
public R getCacheKeys(@PathVariable String cacheName) {
|
||||
Set<String> cacheKeys = redisTemplate.keys(cacheName + "*");
|
||||
return R.ok(cacheKeys);
|
||||
}
|
||||
|
||||
@PreAuthorize("@customSs.hasPermi('monitor:cache:list')")
|
||||
@PreAuthorize("@customSs.hasPermission('monitor:cache:list')")
|
||||
@GetMapping("/getValue/{cacheName}/{cacheKey}")
|
||||
public R getCacheValue(@PathVariable String cacheName, @PathVariable String cacheKey) {
|
||||
String cacheValue = redisTemplate.opsForValue().get(cacheKey);
|
||||
@@ -76,7 +76,7 @@ public class CacheController {
|
||||
return R.ok(cache);
|
||||
}
|
||||
|
||||
@PreAuthorize("@customSs.hasPermi('monitor:cache:list')")
|
||||
@PreAuthorize("@customSs.hasPermission('monitor:cache:list')")
|
||||
@DeleteMapping("/clearCacheName/{cacheName}")
|
||||
public R clearCacheName(@PathVariable String cacheName) {
|
||||
Collection<String> cacheKeys = redisTemplate.keys(cacheName + "*");
|
||||
@@ -84,14 +84,14 @@ public class CacheController {
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@PreAuthorize("@customSs.hasPermi('monitor:cache:list')")
|
||||
@PreAuthorize("@customSs.hasPermission('monitor:cache:list')")
|
||||
@DeleteMapping("/clearCacheKey/{cacheKey}")
|
||||
public R clearCacheKey(@PathVariable String cacheKey) {
|
||||
redisTemplate.delete(cacheKey);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@PreAuthorize("@customSs.hasPermi('monitor:cache:list')")
|
||||
@PreAuthorize("@customSs.hasPermission('monitor:cache:list')")
|
||||
@DeleteMapping("/clearCacheAll")
|
||||
public R clearCacheAll() {
|
||||
Collection<String> cacheKeys = redisTemplate.keys("*");
|
||||
|
||||
@@ -17,7 +17,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
@RequestMapping("/monitor/server")
|
||||
public class ServerController {
|
||||
|
||||
@PreAuthorize("@customSs.hasPermi('monitor:server:list')")
|
||||
@PreAuthorize("@customSs.hasPermission('monitor:server:list')")
|
||||
@GetMapping()
|
||||
public R getInfo() throws Exception {
|
||||
Server server = new Server();
|
||||
|
||||
@@ -34,7 +34,7 @@ public class UserOnlineController {
|
||||
@Resource
|
||||
private UserOnlineService userOnlineService;
|
||||
|
||||
@PreAuthorize("@customSs.hasPermi('monitor:online:list')")
|
||||
@PreAuthorize("@customSs.hasPermission('monitor:online:list')")
|
||||
@GetMapping("/list")
|
||||
public R list(String ipaddr, String userName) {
|
||||
Collection<String> keys = redisCache.keys(CacheConstants.LOGIN_TOKEN_KEY + "*");
|
||||
@@ -66,7 +66,7 @@ public class UserOnlineController {
|
||||
/**
|
||||
* 强退用户
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermi('monitor:online:forceLogout')")
|
||||
@PreAuthorize("@customSs.hasPermission('monitor:online:forceLogout')")
|
||||
@Log(title = "在线用户", businessType = BusinessType.FORCE)
|
||||
@DeleteMapping("/{tokenId}")
|
||||
public R forceLogout(@PathVariable String tokenId) {
|
||||
|
||||
@@ -0,0 +1,226 @@
|
||||
package com.starry.admin.modules.order.controller;
|
||||
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.starry.admin.common.exception.CustomException;
|
||||
import com.starry.admin.modules.commodity.module.entity.CommodityInfoEntity;
|
||||
import com.starry.admin.modules.commodity.service.ICommodityInfoService;
|
||||
import com.starry.admin.modules.coupon.module.entity.CouponInfoEntity;
|
||||
import com.starry.admin.modules.coupon.service.ICouponInfoService;
|
||||
import com.starry.admin.modules.order.module.entity.OrderDetailsInfoEntity;
|
||||
import com.starry.admin.modules.order.module.entity.OrderInfoEntity;
|
||||
import com.starry.admin.modules.order.module.entity.OrderLogInfoEntity;
|
||||
import com.starry.admin.modules.order.module.vo.OrderInfoAddVo;
|
||||
import com.starry.admin.modules.order.module.vo.OrderInfoQueryVo;
|
||||
import com.starry.admin.modules.order.module.vo.OrderInfoRefundVo;
|
||||
import com.starry.admin.modules.order.module.vo.OrderInfoRewardVo;
|
||||
import com.starry.admin.modules.order.service.IOrderDetailsInfoService;
|
||||
import com.starry.admin.modules.order.service.IOrderInfoService;
|
||||
import com.starry.admin.modules.order.service.IOrderLogInfoService;
|
||||
import com.starry.common.annotation.Log;
|
||||
import com.starry.common.enums.BusinessType;
|
||||
import com.starry.common.result.R;
|
||||
import com.starry.common.utils.ConvertUtil;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
/**
|
||||
* 订单管理
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-03-20
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/order/info")
|
||||
public class OrderInfoController {
|
||||
@Resource
|
||||
private IOrderInfoService orderInfoService;
|
||||
|
||||
@Resource
|
||||
private IOrderLogInfoService orderLogInfoService;
|
||||
|
||||
@Resource
|
||||
private IOrderDetailsInfoService orderDetailsInfoService;
|
||||
|
||||
@Resource
|
||||
private ICommodityInfoService commodityInfoService;
|
||||
|
||||
|
||||
@Resource
|
||||
private ICouponInfoService couponInfoService;
|
||||
|
||||
|
||||
@PreAuthorize("@customSs.hasPermission('order/info/create')")
|
||||
@Log(title = "新增打赏订单", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/reward")
|
||||
public R reward(@RequestBody OrderInfoRewardVo addVo) {
|
||||
|
||||
//校验当前用户余额是否充足
|
||||
// if (false) {
|
||||
|
||||
// throw new CustomException("余额不足,无法下单");
|
||||
// }
|
||||
|
||||
// 新增陪玩余额
|
||||
|
||||
// 减少用户余额
|
||||
|
||||
// 新增订单记录(订单信息需完善)
|
||||
OrderInfoEntity entity = ConvertUtil.entityToVo(addVo, OrderInfoEntity.class);
|
||||
orderInfoService.create(entity);
|
||||
// 新增订单处理日志(打赏单,订单直接完成)
|
||||
orderLogInfoService.create(new OrderLogInfoEntity(entity.getId(), "1", new Date()));
|
||||
orderLogInfoService.create(new OrderLogInfoEntity(entity.getId(), "4", new Date()));
|
||||
return R.ok("成功");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增订单
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermission('order/info/create')")
|
||||
@Log(title = "新增普通订单", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/create")
|
||||
public R create(@RequestBody OrderInfoAddVo addVo) {
|
||||
|
||||
//商品总价格
|
||||
long commodityTotalMoney = 0;
|
||||
//订单总价格
|
||||
long orderTotalMoney = 0;
|
||||
//校验商品是否存在
|
||||
for (String commodityInfoId : addVo.getCommodityInfoIds()) {
|
||||
CommodityInfoEntity commodityInfo = commodityInfoService.selectCommodityInfoEntityById(commodityInfoId);
|
||||
if (commodityInfo == null) {
|
||||
throw new CustomException("商品不存在");
|
||||
}
|
||||
}
|
||||
|
||||
//校验优惠券是否存在
|
||||
for (String commodityInfoId : addVo.getCouponIds()) {
|
||||
CouponInfoEntity couponInfo = couponInfoService.selectCouponInfoById(commodityInfoId);
|
||||
if (couponInfo == null) {
|
||||
throw new CustomException("优惠券不存在");
|
||||
}
|
||||
}
|
||||
|
||||
//校验当前用户余额是否充足
|
||||
// if (false) {
|
||||
// throw new CustomException("余额不足,无法下单");
|
||||
// }
|
||||
|
||||
OrderInfoEntity entity = ConvertUtil.entityToVo(addVo, OrderInfoEntity.class);
|
||||
entity.setId(IdUtil.fastSimpleUUID());
|
||||
entity.setFirstOrder(true);
|
||||
entity.setOrderMoney(String.valueOf(orderTotalMoney));
|
||||
|
||||
orderInfoService.create(entity);
|
||||
|
||||
// 记录订单日志
|
||||
orderLogInfoService.create(new OrderLogInfoEntity(entity.getId(), "0", new Date()));
|
||||
// 记录订单详细信息
|
||||
for (String commodityInfoId : addVo.getCommodityInfoIds()) {
|
||||
orderDetailsInfoService.create(new OrderDetailsInfoEntity(entity.getId(), commodityInfoId, "0"));
|
||||
}
|
||||
for (String commodityInfoId : addVo.getCouponIds()) {
|
||||
orderDetailsInfoService.create(new OrderDetailsInfoEntity(entity.getId(), commodityInfoId, "1"));
|
||||
}
|
||||
// 发送通知给陪玩,等待陪玩接单
|
||||
|
||||
return R.ok("下单成功,等待接单");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询订单列表
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermission('order/info/list')")
|
||||
@GetMapping("/list")
|
||||
public R list(OrderInfoQueryVo vo) {
|
||||
return R.ok(orderInfoService.selectOrderInfoList(vo));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据ID查询订单
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermission('order/info/query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public R getInfo(@PathVariable("id") String id) {
|
||||
return R.ok(orderInfoService.selectOrderInfoById(id));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据ID修改订单信息
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermission('order/info/edit')")
|
||||
@Log(title = "修改普通订单", businessType = BusinessType.UPDATE)
|
||||
@PostMapping(value = "/update/{id}")
|
||||
public R update(@PathVariable String id, @RequestBody OrderInfoEntity orderInfoEntity) {
|
||||
orderInfoEntity.setId(id);
|
||||
boolean success = orderInfoService.update(orderInfoEntity);
|
||||
if (success) {
|
||||
return R.ok();
|
||||
}
|
||||
return R.error("修改失败");
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据ID进行订单退款
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermission('order/info/edit')")
|
||||
@Log(title = "发起订单退款申请", businessType = BusinessType.UPDATE)
|
||||
@PostMapping(value = "/refund/{id}")
|
||||
public R refund(@RequestBody OrderInfoRefundVo vo) {
|
||||
OrderInfoEntity entity = orderInfoService.selectOrderInfoById(vo.getId());
|
||||
if (entity == null) {
|
||||
throw new CustomException("订单不存在");
|
||||
}
|
||||
if (!"0".equals(entity.getRefundType())) {
|
||||
throw new CustomException("订单已退款,无法二次退款");
|
||||
}
|
||||
// 订单最终金额
|
||||
long finalAmount = 0;
|
||||
// 部分退款,计算退款金额是否小于订单金额
|
||||
if ("1".equals(vo.getRefundType())) {
|
||||
// 退款金额
|
||||
long refundMoney = Long.getLong(vo.getRefundMoney());
|
||||
// 订单金额
|
||||
long orderMoney = Long.getLong(entity.getOrderMoney());
|
||||
if (refundMoney <= 0) {
|
||||
throw new CustomException("退款金额必须大于0");
|
||||
}
|
||||
if (orderMoney < refundMoney) {
|
||||
throw new CustomException("退款金额必须小于订单总金额");
|
||||
}
|
||||
finalAmount = orderMoney - refundMoney;
|
||||
}
|
||||
|
||||
// 减少陪玩余额
|
||||
|
||||
// 新增用户余额
|
||||
|
||||
// 修改订单信息
|
||||
orderLogInfoService.create(new OrderLogInfoEntity(entity.getId(), "4", new Date()));
|
||||
entity.setFinalAmount(String.valueOf(finalAmount));
|
||||
entity.setRefundType(vo.getRefundType());
|
||||
orderInfoService.update(entity);
|
||||
// 增加订单处理日志
|
||||
|
||||
return R.ok("成功");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除订单
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermission('order/info/remove')")
|
||||
@Log(title = "删除订单", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R remove(@PathVariable String[] ids) {
|
||||
return R.ok(orderInfoService.deleteOrderInfoByIds(ids));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.starry.admin.modules.order.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.starry.admin.modules.order.module.entity.OrderDetailsInfoEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 订单详细Mapper接口
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-03-20
|
||||
*/
|
||||
public interface OrderDetailsInfoMapper extends BaseMapper<OrderDetailsInfoEntity> {
|
||||
/**
|
||||
* 查询订单详细
|
||||
*
|
||||
* @param id 订单详细主键
|
||||
* @return 订单详细
|
||||
*/
|
||||
OrderDetailsInfoEntity selectOrderDetailsInfoById(String id);
|
||||
|
||||
/**
|
||||
* 查询订单详细列表
|
||||
*
|
||||
* @param orderDetailsInfo 订单详细
|
||||
* @return 订单详细集合
|
||||
*/
|
||||
List<OrderDetailsInfoEntity> selectOrderDetailsInfoList(OrderDetailsInfoEntity orderDetailsInfo);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.starry.admin.modules.order.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.starry.admin.modules.order.module.entity.OrderInfoEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 订单Mapper接口
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-03-20
|
||||
*/
|
||||
public interface OrderInfoMapper extends BaseMapper<OrderInfoEntity> {
|
||||
/**
|
||||
* 查询订单
|
||||
* @param id 订单主键
|
||||
* @return 订单
|
||||
*/
|
||||
OrderInfoEntity selectOrderInfoById(String id);
|
||||
|
||||
/**
|
||||
* 查询订单列表
|
||||
* @param orderInfoEntity 订单
|
||||
* @return 订单集合
|
||||
*/
|
||||
List<OrderInfoEntity> selectOrderInfoList(OrderInfoEntity orderInfoEntity);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.starry.admin.modules.order.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.starry.admin.modules.order.module.entity.OrderLogInfoEntity;
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】Mapper接口
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-03-22
|
||||
*/
|
||||
public interface OrderLogInfoMapper extends BaseMapper<OrderLogInfoEntity> {
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package com.starry.admin.modules.order.module.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.starry.common.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】对象 order_details_info
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-03-20
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("order_details_info")
|
||||
public class OrderDetailsInfoEntity extends BaseEntity<OrderDetailsInfoEntity> {
|
||||
|
||||
|
||||
/**
|
||||
* UUID
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 订单ID
|
||||
*/
|
||||
private String orderId;
|
||||
|
||||
/**
|
||||
* 商品ID
|
||||
*/
|
||||
private String commodityId;
|
||||
|
||||
/**
|
||||
* 商品类型【0:1】
|
||||
* 0:服务
|
||||
* 1:优惠券
|
||||
*/
|
||||
private String commodityType;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remake;
|
||||
|
||||
|
||||
public OrderDetailsInfoEntity(String orderId, String commodityId, String commodityType) {
|
||||
this.orderId = orderId;
|
||||
this.commodityId = commodityId;
|
||||
this.commodityType = commodityType;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,101 @@
|
||||
package com.starry.admin.modules.order.module.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.starry.common.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】对象 order_info
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-03-20
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
|
||||
@TableName("order_info")
|
||||
public class OrderInfoEntity extends BaseEntity<OrderInfoEntity> {
|
||||
|
||||
|
||||
/**
|
||||
* uuid
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
private String tenantId;
|
||||
|
||||
/**
|
||||
* 订单状态【0:1:2:3:4:5】
|
||||
* 0:已下单
|
||||
* 1:已审核(退款 或者 提现需要审核,其余不需要)
|
||||
* 2:已接单
|
||||
* 3:已开始
|
||||
* 4:已完成
|
||||
* 5:已取消
|
||||
*/
|
||||
private String orderStatus;
|
||||
|
||||
/**
|
||||
* 订单类型【0:充值订单;1:提现订单;2:普通订单】
|
||||
*/
|
||||
private String orderType;
|
||||
|
||||
/**
|
||||
* 下单类型(0:指定单,1:随机单。2:打赏单)
|
||||
*/
|
||||
private String placeType;
|
||||
|
||||
/**
|
||||
* 是否是首单【0:不是。1:是】
|
||||
*/
|
||||
private Boolean firstOrder;
|
||||
|
||||
/**
|
||||
* 退款类型【0:未退款,1:部分退款,2:全部退款】
|
||||
*/
|
||||
private String refundType;
|
||||
|
||||
/**
|
||||
* 订单金额
|
||||
*/
|
||||
private String orderMoney;
|
||||
|
||||
|
||||
/**
|
||||
* 订单最终金额
|
||||
*/
|
||||
private String finalAmount;
|
||||
|
||||
/**
|
||||
* 下单人
|
||||
*/
|
||||
private String purchaserBy;
|
||||
|
||||
/**
|
||||
* 下单时间
|
||||
*/
|
||||
private Date purchaserTime;
|
||||
|
||||
/**
|
||||
* 审核人
|
||||
*/
|
||||
private String reviewedBy;
|
||||
|
||||
/**
|
||||
* 审核时间
|
||||
*/
|
||||
private Date reviewedTime;
|
||||
|
||||
/**
|
||||
* 审核内容
|
||||
*/
|
||||
private String reviewedRemark;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
package com.starry.admin.modules.order.module.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.starry.common.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("order_log_info")
|
||||
public class OrderLogInfoEntity extends BaseEntity<OrderLogInfoEntity> {
|
||||
|
||||
|
||||
/**
|
||||
* uuid
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
private String tenantId;
|
||||
|
||||
/**
|
||||
* 订单ID
|
||||
*/
|
||||
private String orderId;
|
||||
|
||||
/**
|
||||
* 操作类型
|
||||
* 0:下单
|
||||
* 1:审核
|
||||
* 2:接单
|
||||
* 3:服务
|
||||
* 4:退款
|
||||
* 4:完成
|
||||
* 6:取消
|
||||
*/
|
||||
private String operType;
|
||||
|
||||
/**
|
||||
* 操作时间
|
||||
*/
|
||||
private Date operTime;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
public OrderLogInfoEntity(String orderId, String operType, Date operTime) {
|
||||
this.orderId = orderId;
|
||||
this.operType = operType;
|
||||
this.operTime = operTime;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
package com.starry.admin.modules.order.module.vo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.starry.common.annotation.EnumValue;
|
||||
import com.starry.common.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】对象 order_info
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-03-20
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
|
||||
@TableName("order_info")
|
||||
public class OrderInfoAddVo extends BaseEntity<OrderInfoAddVo> {
|
||||
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
@NotBlank(message = "租户ID不能为空")
|
||||
private String tenantId;
|
||||
|
||||
/**
|
||||
* 订单状态【0:1:2:3:4:5】
|
||||
* 0:已下单
|
||||
* 1:已审核(退款 或者 提现需要审核,其余不需要)
|
||||
* 2:已接单
|
||||
* 3:已开始
|
||||
* 4:已完成
|
||||
* 5:已取消
|
||||
*/
|
||||
private String orderStatus = String.valueOf(0);
|
||||
|
||||
|
||||
/**
|
||||
* 订单类型【0:充值订单;1:提现订单;2:普通订单】
|
||||
*/
|
||||
private String orderType = String.valueOf(2);
|
||||
|
||||
/**
|
||||
* 下单类型(0:指定单,1:随机单。2:打赏单)
|
||||
*/
|
||||
@EnumValue(strValues = {"0", "1"}, message = "退款类型参数异常")
|
||||
@NotBlank(message = "下单类型不能为空")
|
||||
private String placeType;
|
||||
|
||||
|
||||
/**
|
||||
* 商品列表
|
||||
*/
|
||||
@NotNull(message = "商品不能为空")
|
||||
private List<String> commodityInfoIds;
|
||||
|
||||
/**
|
||||
* 优惠券ID列表
|
||||
*/
|
||||
private List<String> couponIds;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
package com.starry.admin.modules.order.module.vo;
|
||||
|
||||
import com.starry.common.domain.BasePageEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】对象 order_info
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-03-20
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class OrderInfoQueryVo extends BasePageEntity {
|
||||
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
private String tenantId;
|
||||
|
||||
/**
|
||||
* 订单状态【0:1:2:3:4:5】
|
||||
* 0:已下单
|
||||
* 1:已审核(退款 或者 提现需要审核,其余不需要)
|
||||
* 2:已接单
|
||||
* 3:已开始
|
||||
* 4:已完成
|
||||
* 5:已取消
|
||||
*/
|
||||
private String orderStatus;
|
||||
|
||||
/**
|
||||
* 订单类型【0:充值订单;1:提现订单;2:普通订单】
|
||||
*/
|
||||
private String orderType;
|
||||
|
||||
/**
|
||||
* 下单类型(0:指定单,1:随机单。2:打赏单)
|
||||
*/
|
||||
private String placeType;
|
||||
|
||||
/**
|
||||
* 是否是首单【0:不是。1:是】
|
||||
*/
|
||||
private Integer firstOrder;
|
||||
|
||||
/**
|
||||
* 退款类型【0:未退款,1:部分退款,2:全部退款】
|
||||
*/
|
||||
private String refundType;
|
||||
|
||||
/**
|
||||
* 订单金额
|
||||
*/
|
||||
private String orderMoney;
|
||||
|
||||
/**
|
||||
* 下单人
|
||||
*/
|
||||
private Date purchaserBy;
|
||||
|
||||
/**
|
||||
* 下单时间
|
||||
*/
|
||||
private Date purchaserTime;
|
||||
|
||||
/**
|
||||
* 审核人
|
||||
*/
|
||||
private String reviewedBy;
|
||||
|
||||
/**
|
||||
* 审核时间
|
||||
*/
|
||||
private Date reviewedTime;
|
||||
|
||||
/**
|
||||
* 审核内容
|
||||
*/
|
||||
private String reviewedRemark;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.starry.admin.modules.order.module.vo;
|
||||
|
||||
import com.starry.common.annotation.EnumValue;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】对象 order_info
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-03-20
|
||||
*/
|
||||
@Data
|
||||
public class OrderInfoRefundVo {
|
||||
|
||||
|
||||
/**
|
||||
* uuid
|
||||
*/
|
||||
@NotNull(message = "订单ID不能为空")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
// @NotNull(message = "租户ID不能为空")
|
||||
private String tenantId;
|
||||
|
||||
|
||||
/**
|
||||
* 退款类型【1:部分退款,2:全部退款】
|
||||
*/
|
||||
@NotNull(message = "退款类型不能为空")
|
||||
@EnumValue(strValues = {"1", "2"}, message = "退款类型参数异常")
|
||||
private String refundType;
|
||||
|
||||
/**
|
||||
* 退款金额,单位分
|
||||
*/
|
||||
private String refundMoney;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package com.starry.admin.modules.order.module.vo;
|
||||
|
||||
import com.starry.common.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】对象 order_info
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-03-20
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
|
||||
public class OrderInfoRewardVo extends BaseEntity<OrderInfoRewardVo> {
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
@NotBlank(message = "租户ID不能为空")
|
||||
private String tenantId;
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
@NotBlank(message = "打赏对象不能为空")
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
* 订单类型【0:充值订单;1:提现订单;2:普通订单】
|
||||
*/
|
||||
private String orderType = String.valueOf(2);
|
||||
|
||||
/**
|
||||
* 下单类型(0:指定单,1:随机单。2:打赏单)
|
||||
*/
|
||||
@NotBlank(message = "下单类型不能为空")
|
||||
private String placeType = "2";
|
||||
|
||||
/**
|
||||
* 金额,单位分
|
||||
*/
|
||||
@NotBlank(message = "打赏金额不能为空")
|
||||
private String money;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package com.starry.admin.modules.order.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.starry.admin.modules.order.module.entity.OrderDetailsInfoEntity;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 订单详细Service接口
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-03-20
|
||||
*/
|
||||
@Service
|
||||
public interface IOrderDetailsInfoService extends IService<OrderDetailsInfoEntity> {
|
||||
/**
|
||||
* 查询订单详细
|
||||
*
|
||||
* @param id 订单详细主键
|
||||
* @return 订单详细
|
||||
*/
|
||||
OrderDetailsInfoEntity selectOrderDetailsInfoById(String id);
|
||||
|
||||
/**
|
||||
* 查询订单详细列表
|
||||
*
|
||||
* @param orderDetailsInfo 订单详细
|
||||
* @return 订单详细集合
|
||||
*/
|
||||
List<OrderDetailsInfoEntity> selectOrderDetailsInfoList(OrderDetailsInfoEntity orderDetailsInfo);
|
||||
|
||||
/**
|
||||
* 新增订单详细
|
||||
*
|
||||
* @param orderDetailsInfo 订单详细
|
||||
* @return 结果
|
||||
*/
|
||||
boolean create(OrderDetailsInfoEntity orderDetailsInfo);
|
||||
|
||||
/**
|
||||
* 修改订单详细
|
||||
*
|
||||
* @param orderDetailsInfo 订单详细
|
||||
* @return 结果
|
||||
*/
|
||||
boolean update(OrderDetailsInfoEntity orderDetailsInfo);
|
||||
|
||||
/**
|
||||
* 批量删除订单详细
|
||||
*
|
||||
* @param ids 需要删除的订单详细主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteOrderDetailsInfoByIds(String[] ids);
|
||||
|
||||
/**
|
||||
* 删除订单详细信息
|
||||
*
|
||||
* @param id 订单详细主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteOrderDetailsInfoById(String id);
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package com.starry.admin.modules.order.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.starry.admin.modules.order.module.entity.OrderInfoEntity;
|
||||
import com.starry.admin.modules.order.module.vo.OrderInfoQueryVo;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 订单Service接口
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-03-20
|
||||
*/
|
||||
@Service
|
||||
public interface IOrderInfoService extends IService<OrderInfoEntity> {
|
||||
/**
|
||||
* 查询订单
|
||||
*
|
||||
* @param id 订单主键
|
||||
* @return 订单
|
||||
*/
|
||||
OrderInfoEntity selectOrderInfoById(String id);
|
||||
|
||||
/**
|
||||
* 查询订单列表
|
||||
*
|
||||
* @param orderInfoEntity 订单
|
||||
* @return 订单集合
|
||||
*/
|
||||
IPage<OrderInfoEntity> selectOrderInfoList(OrderInfoQueryVo orderInfoEntity);
|
||||
|
||||
/**
|
||||
* 新增订单
|
||||
*
|
||||
* @param orderInfoEntity 订单
|
||||
* @return 结果
|
||||
*/
|
||||
boolean create(OrderInfoEntity orderInfoEntity);
|
||||
|
||||
/**
|
||||
* 修改订单
|
||||
*
|
||||
* @param orderInfoEntity 订单
|
||||
* @return 结果
|
||||
*/
|
||||
boolean update(OrderInfoEntity orderInfoEntity);
|
||||
|
||||
/**
|
||||
* 批量删除订单
|
||||
*
|
||||
* @param ids 需要删除的订单主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteOrderInfoByIds(String[] ids);
|
||||
|
||||
/**
|
||||
* 删除订单信息
|
||||
*
|
||||
* @param id 订单主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteOrderInfoById(String id);
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package com.starry.admin.modules.order.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.starry.admin.modules.order.module.entity.OrderLogInfoEntity;
|
||||
/**
|
||||
* 【请填写功能名称】Service接口
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-03-22
|
||||
*/
|
||||
public interface IOrderLogInfoService extends IService<OrderLogInfoEntity> {
|
||||
/**
|
||||
* 查询【请填写功能名称】
|
||||
* @param id 【请填写功能名称】主键
|
||||
* @return 【请填写功能名称】
|
||||
*/
|
||||
OrderLogInfoEntity selectOrderLogInfoById(String id);
|
||||
|
||||
/**
|
||||
* 查询【请填写功能名称】列表
|
||||
* @param orderLogInfo 【请填写功能名称】
|
||||
* @return 【请填写功能名称】集合
|
||||
*/
|
||||
IPage<OrderLogInfoEntity> selectOrderLogInfoByPage(OrderLogInfoEntity orderLogInfo);
|
||||
|
||||
/**
|
||||
* 新增【请填写功能名称】
|
||||
* @param orderLogInfo 【请填写功能名称】
|
||||
* @return 结果
|
||||
*/
|
||||
boolean create(OrderLogInfoEntity orderLogInfo);
|
||||
|
||||
/**
|
||||
* 修改【请填写功能名称】
|
||||
* @param orderLogInfo 【请填写功能名称】
|
||||
* @return 结果
|
||||
*/
|
||||
boolean update(OrderLogInfoEntity orderLogInfo);
|
||||
|
||||
/**
|
||||
* 批量删除【请填写功能名称】
|
||||
*
|
||||
* @param ids 需要删除的【请填写功能名称】主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteOrderLogInfoByIds(String[] ids);
|
||||
|
||||
/**
|
||||
* 删除【请填写功能名称】信息
|
||||
*
|
||||
* @param id 【请填写功能名称】主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteOrderLogInfoById(String id);
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
package com.starry.admin.modules.order.service.impl;
|
||||
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.starry.admin.modules.order.mapper.OrderDetailsInfoMapper;
|
||||
import com.starry.admin.modules.order.module.entity.OrderDetailsInfoEntity;
|
||||
import com.starry.admin.modules.order.service.IOrderDetailsInfoService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 订单详细Service业务层处理
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-03-20
|
||||
*/
|
||||
@Service
|
||||
public class OrderDetailsInfoServiceImpl extends ServiceImpl<OrderDetailsInfoMapper, OrderDetailsInfoEntity> implements IOrderDetailsInfoService {
|
||||
@Resource
|
||||
private OrderDetailsInfoMapper orderDetailsInfoMapper;
|
||||
|
||||
/**
|
||||
* 查询订单详细
|
||||
*
|
||||
* @param id 订单详细主键
|
||||
* @return 订单详细
|
||||
*/
|
||||
@Override
|
||||
public OrderDetailsInfoEntity selectOrderDetailsInfoById(String id) {
|
||||
return orderDetailsInfoMapper.selectOrderDetailsInfoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询订单详细列表
|
||||
*
|
||||
* @param orderDetailsInfo 订单详细
|
||||
* @return 订单详细
|
||||
*/
|
||||
@Override
|
||||
public List<OrderDetailsInfoEntity> selectOrderDetailsInfoList(OrderDetailsInfoEntity orderDetailsInfo) {
|
||||
return orderDetailsInfoMapper.selectOrderDetailsInfoList(orderDetailsInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增订单详细
|
||||
*
|
||||
* @param orderDetailsInfo 订单详细
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public boolean create(OrderDetailsInfoEntity orderDetailsInfo) {
|
||||
if (StrUtil.isBlankIfStr(orderDetailsInfo.getId())) {
|
||||
orderDetailsInfo.setId(IdUtil.fastSimpleUUID());
|
||||
}
|
||||
return save(orderDetailsInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改订单详细
|
||||
*
|
||||
* @param orderDetailsInfo 订单详细
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public boolean update(OrderDetailsInfoEntity orderDetailsInfo) {
|
||||
return updateById(orderDetailsInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除订单详细
|
||||
*
|
||||
* @param ids 需要删除的订单详细主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteOrderDetailsInfoByIds(String[] ids) {
|
||||
return orderDetailsInfoMapper.deleteBatchIds(Arrays.asList(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除订单详细信息
|
||||
*
|
||||
* @param id 订单详细主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteOrderDetailsInfoById(String id) {
|
||||
return orderDetailsInfoMapper.deleteById(id);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
package com.starry.admin.modules.order.service.impl;
|
||||
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.starry.admin.modules.order.mapper.OrderInfoMapper;
|
||||
import com.starry.admin.modules.order.module.entity.OrderInfoEntity;
|
||||
import com.starry.admin.modules.order.module.vo.OrderInfoQueryVo;
|
||||
import com.starry.admin.modules.order.service.IOrderInfoService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 订单Service业务层处理
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-03-20
|
||||
*/
|
||||
@Service
|
||||
public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfoEntity> implements IOrderInfoService {
|
||||
@Resource
|
||||
private OrderInfoMapper orderInfoMapper;
|
||||
|
||||
/**
|
||||
* 查询订单
|
||||
*
|
||||
* @param id 订单主键
|
||||
* @return 订单
|
||||
*/
|
||||
@Override
|
||||
public OrderInfoEntity selectOrderInfoById(String id) {
|
||||
return orderInfoMapper.selectOrderInfoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询订单信息
|
||||
*
|
||||
* @param vo 订单分页查询对象
|
||||
* @return 订单分页查询结果
|
||||
*/
|
||||
@Override
|
||||
public IPage<OrderInfoEntity> selectOrderInfoList(OrderInfoQueryVo vo) {
|
||||
Page<OrderInfoEntity> page = new Page<>(vo.getPageNum(), vo.getPageSize());
|
||||
LambdaQueryWrapper<OrderInfoEntity> queryWrapper = new LambdaQueryWrapper<>();
|
||||
return this.baseMapper.selectPage(page, queryWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增订单
|
||||
*
|
||||
* @param orderInfo 订单
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public boolean create(OrderInfoEntity orderInfo) {
|
||||
if (StrUtil.isBlankIfStr(orderInfo.getId())) {
|
||||
orderInfo.setId(IdUtil.fastSimpleUUID());
|
||||
}
|
||||
orderInfo.setPurchaserBy("sysadmin");
|
||||
orderInfo.setPurchaserTime(new Date());
|
||||
orderInfo.setReviewedBy("sysadmin");
|
||||
orderInfo.setReviewedTime(new Date());
|
||||
return save(orderInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改订单
|
||||
*
|
||||
* @param orderInfo 订单
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public boolean update(OrderInfoEntity orderInfo) {
|
||||
return updateById(orderInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除订单
|
||||
*
|
||||
* @param ids 需要删除的订单主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteOrderInfoByIds(String[] ids) {
|
||||
return orderInfoMapper.deleteBatchIds(Arrays.asList(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除订单信息
|
||||
*
|
||||
* @param id 订单主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteOrderInfoById(String id) {
|
||||
return orderInfoMapper.deleteById(id);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
package com.starry.admin.modules.order.service.impl;
|
||||
|
||||
import java.util.Arrays;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.starry.admin.modules.order.mapper.OrderLogInfoMapper;
|
||||
import com.starry.admin.modules.order.module.entity.OrderLogInfoEntity;
|
||||
import com.starry.admin.modules.order.service.IOrderLogInfoService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】Service业务层处理
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-03-22
|
||||
*/
|
||||
@Service
|
||||
public class OrderLogInfoServiceImpl extends ServiceImpl<OrderLogInfoMapper, OrderLogInfoEntity> implements IOrderLogInfoService {
|
||||
@Resource
|
||||
private OrderLogInfoMapper orderLogInfoMapper;
|
||||
|
||||
/**
|
||||
* 查询【请填写功能名称】
|
||||
* @param id 【请填写功能名称】主键
|
||||
* @return 【请填写功能名称】
|
||||
*/
|
||||
@Override
|
||||
public OrderLogInfoEntity selectOrderLogInfoById(String id) {
|
||||
return this.baseMapper.selectById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询【请填写功能名称】列表
|
||||
* @param orderLogInfo 【请填写功能名称】
|
||||
* @return 【请填写功能名称】
|
||||
*/
|
||||
@Override
|
||||
public IPage<OrderLogInfoEntity> selectOrderLogInfoByPage(OrderLogInfoEntity orderLogInfo) {
|
||||
Page<OrderLogInfoEntity> page = new Page<>(1, 10);
|
||||
return this.baseMapper.selectPage(page, new LambdaQueryWrapper<OrderLogInfoEntity>());
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增【请填写功能名称】
|
||||
* @param orderLogInfo 【请填写功能名称】
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public boolean create(OrderLogInfoEntity orderLogInfo) {
|
||||
if (StrUtil.isBlankIfStr(orderLogInfo.getId())) {
|
||||
orderLogInfo.setId(IdUtil.fastSimpleUUID());
|
||||
}
|
||||
return save(orderLogInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改【请填写功能名称】
|
||||
* @param orderLogInfo 【请填写功能名称】
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public boolean update(OrderLogInfoEntity orderLogInfo) {
|
||||
return updateById(orderLogInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除【请填写功能名称】
|
||||
* @param ids 需要删除的【请填写功能名称】主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteOrderLogInfoByIds(String[] ids) {
|
||||
return orderLogInfoMapper.deleteBatchIds(Arrays.asList(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除【请填写功能名称】信息
|
||||
* @param id 【请填写功能名称】主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteOrderLogInfoById(String id) {
|
||||
return orderLogInfoMapper.deleteById(id);
|
||||
}
|
||||
}
|
||||
@@ -32,7 +32,7 @@ public class SysTenantController {
|
||||
/**
|
||||
* 新增租户表
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermi('platform:tenant:create')")
|
||||
@PreAuthorize("@customSs.hasPermission('platform:tenant:create')")
|
||||
@Log(title = "租户表", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/create")
|
||||
public R create(@Valid @RequestBody SysTenantAddVo vo) {
|
||||
@@ -46,7 +46,7 @@ public class SysTenantController {
|
||||
/**
|
||||
* 查询租户表列表
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermi('platform:tenant:list')")
|
||||
@PreAuthorize("@customSs.hasPermission('platform:tenant:list')")
|
||||
@GetMapping("/list")
|
||||
public R list(SysTenantQueryVo vo) {
|
||||
return R.ok(sysTenantService.selectSysTenantList(vo));
|
||||
@@ -55,7 +55,7 @@ public class SysTenantController {
|
||||
/**
|
||||
* 导出租户表列表
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermi('platform:tenant:export')")
|
||||
@PreAuthorize("@customSs.hasPermission('platform:tenant:export')")
|
||||
@Log(title = "租户表", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, SysTenantQueryVo sysTenantEntity) {
|
||||
@@ -65,7 +65,7 @@ public class SysTenantController {
|
||||
/**
|
||||
* 获取租户表详细信息
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermi('platform:tenant:query')")
|
||||
@PreAuthorize("@customSs.hasPermission('platform:tenant:query')")
|
||||
@GetMapping(value = "/{tenantId}")
|
||||
public R getInfo(@PathVariable("tenantId") String tenantId) {
|
||||
return R.ok(sysTenantService.selectSysTenantByTenantId(tenantId));
|
||||
@@ -75,7 +75,7 @@ public class SysTenantController {
|
||||
/**
|
||||
* 修改租户表
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermi('platform:tenant:edit')")
|
||||
@PreAuthorize("@customSs.hasPermission('platform:tenant:edit')")
|
||||
@Log(title = "租户表", businessType = BusinessType.UPDATE)
|
||||
@PostMapping(value = "/update/{tenantId}")
|
||||
public R update(@PathVariable String tenantId, @RequestBody SysTenantEntity sysTenantEntity) {
|
||||
@@ -85,7 +85,7 @@ public class SysTenantController {
|
||||
/**
|
||||
* 删除租户表
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermi('platform:tenant:remove')")
|
||||
@PreAuthorize("@customSs.hasPermission('platform:tenant:remove')")
|
||||
@Log(title = "租户表", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{tenantIds}")
|
||||
public R remove(@PathVariable String[] tenantIds) {
|
||||
|
||||
@@ -31,7 +31,7 @@ public class SysTenantPackageController {
|
||||
/**
|
||||
* 查询租户套餐表列表
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermi('platform:package:list')")
|
||||
@PreAuthorize("@customSs.hasPermission('platform:package:list')")
|
||||
@GetMapping("/list")
|
||||
public R list(SysTenantPackageVo sysTenantPackageEntity) {
|
||||
return R.ok(SysTenantPackageService.selectSysTenantPackageList(sysTenantPackageEntity));
|
||||
@@ -40,7 +40,7 @@ public class SysTenantPackageController {
|
||||
/**
|
||||
* 导出租户套餐表列表
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermi('platform:package:export')")
|
||||
@PreAuthorize("@customSs.hasPermission('platform:package:export')")
|
||||
@Log(title = "租户套餐表", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, SysTenantPackageVo sysTenantPackageEntity) {
|
||||
@@ -50,7 +50,7 @@ public class SysTenantPackageController {
|
||||
/**
|
||||
* 获取租户套餐表详细信息
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermi('platform:package:query')")
|
||||
@PreAuthorize("@customSs.hasPermission('platform:package:query')")
|
||||
@GetMapping(value = "/{packageId}")
|
||||
public R getInfo(@PathVariable("packageId") String packageId) {
|
||||
return R.ok(SysTenantPackageService.selectSysTenantPackageByPackageId(packageId));
|
||||
@@ -59,7 +59,7 @@ public class SysTenantPackageController {
|
||||
/**
|
||||
* 新增租户套餐表
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermi('platform:package:create')")
|
||||
@PreAuthorize("@customSs.hasPermission('platform:package:create')")
|
||||
@Log(title = "租户套餐表", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/create")
|
||||
public R create(@RequestBody SysTenantPackageEntity vo) {
|
||||
@@ -74,7 +74,7 @@ public class SysTenantPackageController {
|
||||
/**
|
||||
* 修改租户套餐表
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermi('platform:package:edit')")
|
||||
@PreAuthorize("@customSs.hasPermission('platform:package:edit')")
|
||||
@Log(title = "租户套餐表", businessType = BusinessType.UPDATE)
|
||||
@PostMapping(value = "/update/{packageId}")
|
||||
public R update(@PathVariable String packageId, @RequestBody SysTenantPackageEntity sysTenantPackageEntity) {
|
||||
@@ -90,7 +90,7 @@ public class SysTenantPackageController {
|
||||
/**
|
||||
* 删除租户套餐表
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermi('platform:package:remove')")
|
||||
@PreAuthorize("@customSs.hasPermission('platform:package:remove')")
|
||||
@Log(title = "租户套餐表", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{packageIds}")
|
||||
public R remove(@PathVariable String[] packageIds) {
|
||||
|
||||
@@ -30,7 +30,7 @@ public class SysDeptController {
|
||||
private SysDeptService deptService;
|
||||
|
||||
@ApiOperation("获取部门列表")
|
||||
@PreAuthorize("@customSs.hasPermi('system:dept:list')")
|
||||
@PreAuthorize("@customSs.hasPermission('system:dept:list')")
|
||||
@GetMapping("/list")
|
||||
public R list(SysDeptEntity dept) {
|
||||
List<SysDeptEntity> depts = deptService.selectDeptList(dept);
|
||||
@@ -38,7 +38,7 @@ public class SysDeptController {
|
||||
}
|
||||
|
||||
@ApiOperation("添加部门")
|
||||
@PreAuthorize("@customSs.hasPermi('system:dept:create')")
|
||||
@PreAuthorize("@customSs.hasPermission('system:dept:create')")
|
||||
@PostMapping("/create")
|
||||
public R creat(@RequestBody SysDeptEntity dept) {
|
||||
if (UserConstants.NOT_UNIQUE.equals(deptService.checkDeptNameUnique(dept))) {
|
||||
@@ -52,7 +52,7 @@ public class SysDeptController {
|
||||
}
|
||||
|
||||
@ApiOperation("修改部门")
|
||||
@PreAuthorize("@customSs.hasPermi('system:dept:edit')")
|
||||
@PreAuthorize("@customSs.hasPermission('system:dept:edit')")
|
||||
@PostMapping("/update/{id}")
|
||||
public R update(@PathVariable Long id, @RequestBody SysDeptEntity dept) {
|
||||
dept.setDeptId(id);
|
||||
@@ -69,7 +69,7 @@ public class SysDeptController {
|
||||
}
|
||||
|
||||
@ApiOperation("删除部门")
|
||||
@PreAuthorize("@customSs.hasPermi('system:dept:delete')")
|
||||
@PreAuthorize("@customSs.hasPermission('system:dept:delete')")
|
||||
@PostMapping(value = "/delete/{id}")
|
||||
public R delete(@PathVariable("id") Long deptId) {
|
||||
if (deptService.hasChildByDeptId(deptId)) {
|
||||
|
||||
@@ -28,7 +28,7 @@ public class SysDictController {
|
||||
/**
|
||||
* 查询字典表列表
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermi('system:dict:list')")
|
||||
@PreAuthorize("@customSs.hasPermission('system:dict:list')")
|
||||
@GetMapping("/list")
|
||||
public R list(SysDictVo dictVo) {
|
||||
Page<SysDictEntity> list = xlDictService.selectXlDictList(dictVo);
|
||||
@@ -39,7 +39,7 @@ public class SysDictController {
|
||||
/**
|
||||
* 获取字典表详细信息
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermi('system:dict:query')")
|
||||
@PreAuthorize("@customSs.hasPermission('system:dict:query')")
|
||||
@GetMapping(value = "/{dictId}")
|
||||
public R getInfo(@PathVariable("dictId") Long dictId) {
|
||||
return R.ok(xlDictService.selectXlDictByDictId(dictId));
|
||||
@@ -48,7 +48,7 @@ public class SysDictController {
|
||||
/**
|
||||
* 新增字典表
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermi('system:dict:create')")
|
||||
@PreAuthorize("@customSs.hasPermission('system:dict:create')")
|
||||
@Log(title = "字典表", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/create")
|
||||
public R create(@RequestBody SysDictEntity sysDictEntity) {
|
||||
@@ -62,7 +62,7 @@ public class SysDictController {
|
||||
/**
|
||||
* 修改字典表
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermi('system:dict:edit')")
|
||||
@PreAuthorize("@customSs.hasPermission('system:dict:edit')")
|
||||
@Log(title = "字典表", businessType = BusinessType.UPDATE)
|
||||
@PostMapping(value = "/update/{dictId}")
|
||||
public R update(@PathVariable Long dictId, @RequestBody SysDictEntity sysDictEntity) {
|
||||
@@ -77,7 +77,7 @@ public class SysDictController {
|
||||
/**
|
||||
* 删除字典表
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermi('system:dict:remove')")
|
||||
@PreAuthorize("@customSs.hasPermission('system:dict:remove')")
|
||||
@Log(title = "字典表", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{dictIds}")
|
||||
public R remove(@PathVariable Long[] dictIds) {
|
||||
@@ -93,7 +93,7 @@ public class SysDictController {
|
||||
/**
|
||||
* 刷新字典缓存
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermi('system:dict:remove')")
|
||||
@PreAuthorize("@customSs.hasPermission('system:dict:remove')")
|
||||
@Log(title = "字典类型", businessType = BusinessType.CLEAN)
|
||||
@DeleteMapping("/refreshCache")
|
||||
public R refreshCache() {
|
||||
|
||||
@@ -29,7 +29,7 @@ public class SysDictDataController {
|
||||
/**
|
||||
* 查询字典数据表列表
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermi('system:dict:list')")
|
||||
@PreAuthorize("@customSs.hasPermission('system:dict:list')")
|
||||
@GetMapping("/list")
|
||||
public R list(SysDictDataVo sysDictDataEntity) {
|
||||
return R.ok(xlDictDataService.selectXlDictDataList(sysDictDataEntity));
|
||||
@@ -39,7 +39,7 @@ public class SysDictDataController {
|
||||
/**
|
||||
* 获取字典数据表详细信息
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermi('system:dict:query')")
|
||||
@PreAuthorize("@customSs.hasPermission('system:dict:query')")
|
||||
@GetMapping(value = "/{dictDataId}")
|
||||
public R getInfo(@PathVariable("dictDataId") Long dictDataId) {
|
||||
return R.ok(xlDictDataService.selectXlDictDataByDictDataId(dictDataId));
|
||||
@@ -48,7 +48,7 @@ public class SysDictDataController {
|
||||
/**
|
||||
* 新增字典数据表
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermi('system:dict:create')")
|
||||
@PreAuthorize("@customSs.hasPermission('system:dict:create')")
|
||||
@Log(title = "字典数据表", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/create")
|
||||
public R create(@RequestBody SysDictDataEntity sysDictDataEntity) {
|
||||
@@ -62,7 +62,7 @@ public class SysDictDataController {
|
||||
/**
|
||||
* 修改字典数据表
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermi('system:dict:edit')")
|
||||
@PreAuthorize("@customSs.hasPermission('system:dict:edit')")
|
||||
@Log(title = "字典数据表", businessType = BusinessType.UPDATE)
|
||||
@PostMapping(value = "/update/{dictDataId}")
|
||||
public R update(@PathVariable Long dictDataId, @RequestBody SysDictDataEntity sysDictDataEntity) {
|
||||
@@ -77,7 +77,7 @@ public class SysDictDataController {
|
||||
/**
|
||||
* 删除字典数据表
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermi('system:dict:remove')")
|
||||
@PreAuthorize("@customSs.hasPermission('system:dict:remove')")
|
||||
@Log(title = "字典数据表", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{dictDataIds}")
|
||||
public R remove(@PathVariable Long[] dictDataIds) {
|
||||
|
||||
@@ -30,7 +30,7 @@ public class SysLoginLogController {
|
||||
/**
|
||||
* 查询系统访问日志表列表
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermi('system:loginlog:list')")
|
||||
@PreAuthorize("@customSs.hasPermission('system:loginlog:list')")
|
||||
@GetMapping("/list")
|
||||
public R list(SysLoginLogVo vo) {
|
||||
IPage<SysLoginLogEntity> list = xlLoginLogService.selectXlLoginLogList(vo);
|
||||
@@ -40,7 +40,7 @@ public class SysLoginLogController {
|
||||
/**
|
||||
* 导出系统访问日志表列表
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermi('system:loginlog:export')")
|
||||
@PreAuthorize("@customSs.hasPermission('system:loginlog:export')")
|
||||
@Log(title = "登录日志", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, SysLoginLogVo vo) {
|
||||
@@ -51,7 +51,7 @@ public class SysLoginLogController {
|
||||
/**
|
||||
* 获取系统访问日志表详细信息
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermi('system:log:query')")
|
||||
@PreAuthorize("@customSs.hasPermission('system:log:query')")
|
||||
@GetMapping(value = "/{loginId}")
|
||||
public R getInfo(@PathVariable("loginId") Long loginId) {
|
||||
return R.ok(xlLoginLogService.selectXlLoginLogByLoginId(loginId));
|
||||
@@ -60,14 +60,14 @@ public class SysLoginLogController {
|
||||
/**
|
||||
* 删除系统访问日志表
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermi('system:loginlog:remove')")
|
||||
@PreAuthorize("@customSs.hasPermission('system:loginlog:remove')")
|
||||
@Log(title = "登录日志", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{loginIds}")
|
||||
public R remove(@PathVariable Long[] loginIds) {
|
||||
return R.ok(xlLoginLogService.deleteXlLoginLogByLoginIds(loginIds));
|
||||
}
|
||||
|
||||
@PreAuthorize("@customSs.hasPermi('monitor:logininfor:clean')")
|
||||
@PreAuthorize("@customSs.hasPermission('monitor:logininfor:clean')")
|
||||
@Log(title = "登录日志", businessType = BusinessType.CLEAN)
|
||||
@DeleteMapping("/clean")
|
||||
public R clean() {
|
||||
|
||||
@@ -37,7 +37,7 @@ public class SysMenuController {
|
||||
|
||||
|
||||
@ApiOperation("获取菜单列表")
|
||||
@PreAuthorize("@customSs.hasPermi('system:menu:list')")
|
||||
@PreAuthorize("@customSs.hasPermission('system:menu:list')")
|
||||
@GetMapping("/list")
|
||||
public R list(SysMenuEntity menu) {
|
||||
// 获取登录人的userId;
|
||||
@@ -56,7 +56,7 @@ public class SysMenuController {
|
||||
}
|
||||
|
||||
@ApiOperation("添加菜单")
|
||||
@PreAuthorize("@customSs.hasPermi('system:menu:create')")
|
||||
@PreAuthorize("@customSs.hasPermission('system:menu:create')")
|
||||
@PostMapping("/create")
|
||||
public R create(@RequestBody SysMenuEntity menu) {
|
||||
if (UserConstants.NOT_UNIQUE.equals(menuService.checkMenuNameUnique(menu))) {
|
||||
@@ -72,7 +72,7 @@ public class SysMenuController {
|
||||
}
|
||||
|
||||
@ApiOperation("修改菜单")
|
||||
@PreAuthorize("@customSs.hasPermi('system:menu:edit')")
|
||||
@PreAuthorize("@customSs.hasPermission('system:menu:edit')")
|
||||
@PostMapping("/update/{id}")
|
||||
public R update(@PathVariable Long id, @RequestBody SysMenuEntity menu) {
|
||||
menu.setMenuId(id);
|
||||
@@ -91,7 +91,7 @@ public class SysMenuController {
|
||||
}
|
||||
|
||||
@ApiOperation("删除菜单")
|
||||
@PreAuthorize("@customSs.hasPermi('system:menu:delete')")
|
||||
@PreAuthorize("@customSs.hasPermission('system:menu:delete')")
|
||||
@PostMapping(value = "/delete/{id}")
|
||||
public R delete(@PathVariable("id") Long menuId) {
|
||||
if (menuService.hasChildByMenuId(menuId)) {
|
||||
@@ -112,7 +112,7 @@ public class SysMenuController {
|
||||
return R.ok(tree);
|
||||
}
|
||||
|
||||
@PreAuthorize("@customSs.hasPermi('system:menu:query')")
|
||||
@PreAuthorize("@customSs.hasPermission('system:menu:query')")
|
||||
@ApiOperation("根据菜单编号获取详细信息")
|
||||
@GetMapping(value = "/{menuId}")
|
||||
public R getInfo(@PathVariable Long menuId) {
|
||||
|
||||
@@ -30,7 +30,7 @@ public class SysOperationLogController {
|
||||
/**
|
||||
* 查询操作日志表列表
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermi('system:operlog:list')")
|
||||
@PreAuthorize("@customSs.hasPermission('system:operlog:list')")
|
||||
@GetMapping("/list")
|
||||
public R list(SysOperationLogVo sysOperationLogEntity) {
|
||||
return R.ok(xlOperLogService.selectXlOperLogList(sysOperationLogEntity));
|
||||
@@ -39,7 +39,7 @@ public class SysOperationLogController {
|
||||
/**
|
||||
* 获取操作日志表详细信息
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermi('system:operlog:query')")
|
||||
@PreAuthorize("@customSs.hasPermission('system:operlog:query')")
|
||||
@GetMapping(value = "/{operId}")
|
||||
public R getInfo(@PathVariable("operId") Long operId) {
|
||||
return R.ok(xlOperLogService.selectXlOperLogByOperId(operId));
|
||||
@@ -48,7 +48,7 @@ public class SysOperationLogController {
|
||||
/**
|
||||
* 新增操作日志表
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermi('system:operlog:create')")
|
||||
@PreAuthorize("@customSs.hasPermission('system:operlog:create')")
|
||||
@Log(title = "操作日志表", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public R create(@RequestBody SysOperationLogEntity sysOperationLogEntity) {
|
||||
@@ -62,7 +62,7 @@ public class SysOperationLogController {
|
||||
/**
|
||||
* 修改操作日志表
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermi('system:operlog:edit')")
|
||||
@PreAuthorize("@customSs.hasPermission('system:operlog:edit')")
|
||||
@Log(title = "操作日志表", businessType = BusinessType.UPDATE)
|
||||
@PostMapping(value = "/update/{operId}")
|
||||
public R update(@PathVariable Long operId, @RequestBody SysOperationLogEntity sysOperationLogEntity) {
|
||||
@@ -77,7 +77,7 @@ public class SysOperationLogController {
|
||||
/**
|
||||
* 删除操作日志表
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermi('system:operlog:remove')")
|
||||
@PreAuthorize("@customSs.hasPermission('system:operlog:remove')")
|
||||
@Log(title = "操作日志表", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{operIds}")
|
||||
public R remove(@PathVariable Long[] operIds) {
|
||||
@@ -87,7 +87,7 @@ public class SysOperationLogController {
|
||||
/**
|
||||
* 导出操作日志表
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermi('system:operlog:export')")
|
||||
@PreAuthorize("@customSs.hasPermission('system:operlog:export')")
|
||||
@Log(title = "操作日志", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, SysOperationLogVo sysOperationLogEntity) {
|
||||
|
||||
@@ -49,7 +49,7 @@ public class SysRoleController {
|
||||
private SysUserService userService;
|
||||
|
||||
@ApiOperation("添加角色")
|
||||
@PreAuthorize("@customSs.hasPermi('system:role:create')")
|
||||
@PreAuthorize("@customSs.hasPermission('system:role:create')")
|
||||
@PostMapping("/create")
|
||||
public R create(@Valid @RequestBody SysRoleAddVo roleAddVo) {
|
||||
SysRoleEntity role = new SysRoleEntity();
|
||||
@@ -67,7 +67,7 @@ public class SysRoleController {
|
||||
}
|
||||
|
||||
@ApiOperation("修改角色")
|
||||
@PreAuthorize("@customSs.hasPermi('system:role:edit')")
|
||||
@PreAuthorize("@customSs.hasPermission('system:role:edit')")
|
||||
@PostMapping("/update/{id}")
|
||||
public R update(@PathVariable Long id, @RequestBody SysRoleEntity role) {
|
||||
role.setRoleId(id);
|
||||
@@ -86,7 +86,7 @@ public class SysRoleController {
|
||||
}
|
||||
|
||||
@ApiOperation("批量删除角色")
|
||||
@PreAuthorize("@customSs.hasPermi('system:role:remove')")
|
||||
@PreAuthorize("@customSs.hasPermission('system:role:remove')")
|
||||
@DeleteMapping("/{roleIds}")
|
||||
public R delete(@PathVariable Long[] roleIds) {
|
||||
boolean success = roleService.delete(roleIds);
|
||||
@@ -111,7 +111,7 @@ public class SysRoleController {
|
||||
}
|
||||
|
||||
@ApiOperation("修改角色状态")
|
||||
@PreAuthorize("@customSs.hasPermi('system:role:edit')")
|
||||
@PreAuthorize("@customSs.hasPermission('system:role:edit')")
|
||||
@PostMapping("/update-status/{id}")
|
||||
public R updateStatus(@PathVariable Long id, @RequestParam(value = "status") Integer status) {
|
||||
SysRoleEntity role = new SysRoleEntity();
|
||||
@@ -125,7 +125,7 @@ public class SysRoleController {
|
||||
}
|
||||
|
||||
@ApiOperation("分配菜单权限")
|
||||
@PreAuthorize("@customSs.hasPermi('system:role:auth')")
|
||||
@PreAuthorize("@customSs.hasPermission('system:role:auth')")
|
||||
@PostMapping("/auth-role-menu")
|
||||
public R authRoleMenu(@RequestBody SysRoleEntity role) {
|
||||
boolean success = roleService.authRoleMenu(role);
|
||||
@@ -138,7 +138,7 @@ public class SysRoleController {
|
||||
/**
|
||||
* 根据角色编号获取详细信息
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermi('system:role:query')")
|
||||
@PreAuthorize("@customSs.hasPermission('system:role:query')")
|
||||
@GetMapping(value = "/{roleId}")
|
||||
public R getInfo(@PathVariable Long roleId) {
|
||||
roleService.checkRoleDataScope(roleId);
|
||||
@@ -149,7 +149,7 @@ public class SysRoleController {
|
||||
* 获取对应角色部门树列表
|
||||
*/
|
||||
@ApiOperation("获取对应角色部门树列表")
|
||||
@PreAuthorize("@customSs.hasPermi('system:role:query')")
|
||||
@PreAuthorize("@customSs.hasPermission('system:role:query')")
|
||||
@GetMapping(value = "/deptTree/{roleId}")
|
||||
public R deptTree(@PathVariable("roleId") Long roleId) {
|
||||
Map<String, Object> resultMap = new HashMap<>(8);
|
||||
@@ -162,7 +162,7 @@ public class SysRoleController {
|
||||
* 修改保存数据权限
|
||||
*/
|
||||
@ApiOperation("修改保存数据权限")
|
||||
@PreAuthorize("@customSs.hasPermi('system:role:query')")
|
||||
@PreAuthorize("@customSs.hasPermission('system:role:query')")
|
||||
@Log(title = "角色管理-保存数据权限", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/dataScope")
|
||||
public R dataScope(@RequestBody SysRoleEntity role) {
|
||||
@@ -175,7 +175,7 @@ public class SysRoleController {
|
||||
* 查询已分配用户角色列表
|
||||
*/
|
||||
@ApiOperation("查询已分配用户角色列表")
|
||||
@PreAuthorize("@customSs.hasPermi('system:role:list')")
|
||||
@PreAuthorize("@customSs.hasPermission('system:role:list')")
|
||||
@GetMapping("/authUser/allocatedList")
|
||||
public R allocatedList(SysUserQueryVo user) {
|
||||
IPage<RoleUserResultVo> list = userService.selectAllocatedList(user);
|
||||
@@ -186,7 +186,7 @@ public class SysRoleController {
|
||||
* 查询未分配用户角色列表
|
||||
*/
|
||||
@ApiOperation("查询未分配用户角色列表")
|
||||
@PreAuthorize("@customSs.hasPermi('system:role:list')")
|
||||
@PreAuthorize("@customSs.hasPermission('system:role:list')")
|
||||
@GetMapping("/authUser/unallocatedList")
|
||||
public R unallocatedList(SysUserQueryVo user) {
|
||||
return R.ok(userService.selectUnallocatedList(user));
|
||||
@@ -196,7 +196,7 @@ public class SysRoleController {
|
||||
* 取消授权用户
|
||||
*/
|
||||
@ApiOperation("取消授权用户")
|
||||
@PreAuthorize("@customSs.hasPermi('system:role:edit')")
|
||||
@PreAuthorize("@customSs.hasPermission('system:role:edit')")
|
||||
@Log(title = "角色管理", businessType = BusinessType.GRANT)
|
||||
@PutMapping("/authUser/cancel")
|
||||
public R cancelAuthUser(@RequestBody SysUserRoleEntity userRole) {
|
||||
@@ -207,7 +207,7 @@ public class SysRoleController {
|
||||
* 批量取消授权用户
|
||||
*/
|
||||
@ApiOperation("批量取消授权用户")
|
||||
@PreAuthorize("@customSs.hasPermi('system:role:edit')")
|
||||
@PreAuthorize("@customSs.hasPermission('system:role:edit')")
|
||||
@Log(title = "角色管理", businessType = BusinessType.GRANT)
|
||||
@PutMapping("/authUser/cancelAll")
|
||||
public R cancelAuthUserAll(Long roleId, String[] userIds) {
|
||||
@@ -218,7 +218,7 @@ public class SysRoleController {
|
||||
* 批量选择用户授权
|
||||
*/
|
||||
@ApiOperation("批量选择用户授权")
|
||||
@PreAuthorize("@customSs.hasPermi('system:role:edit')")
|
||||
@PreAuthorize("@customSs.hasPermission('system:role:edit')")
|
||||
@Log(title = "角色管理", businessType = BusinessType.GRANT)
|
||||
@PutMapping("/authUser/selectAll")
|
||||
public R selectAuthUserAll(Long roleId, String[] userIds) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.starry.weichat.builder;
|
||||
package com.starry.admin.modules.weichat.builder;
|
||||
|
||||
import me.chanjar.weixin.mp.api.WxMpService;
|
||||
import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage;
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
package com.starry.weichat.builder;
|
||||
package com.starry.admin.modules.weichat.builder;
|
||||
|
||||
import me.chanjar.weixin.mp.api.WxMpService;
|
||||
import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage;
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
package com.starry.weichat.builder;
|
||||
package com.starry.admin.modules.weichat.builder;
|
||||
|
||||
import me.chanjar.weixin.mp.api.WxMpService;
|
||||
import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage;
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
package com.starry.weichat.config;
|
||||
package com.starry.admin.modules.weichat.config;
|
||||
|
||||
/**
|
||||
* @author admin
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.starry.weichat.config;
|
||||
package com.starry.admin.modules.weichat.config;
|
||||
|
||||
import com.starry.weichat.interceptor.ThirdSessionInterceptor;
|
||||
import com.starry.admin.modules.weichat.interceptor.ThirdSessionInterceptor;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
||||
@@ -1,20 +1,22 @@
|
||||
|
||||
package com.starry.weichat.config;
|
||||
package com.starry.admin.modules.weichat.config;
|
||||
|
||||
|
||||
import com.starry.weichat.handler.*;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.starry.admin.modules.weichat.entity.CustomWxMpProperties;
|
||||
import com.starry.admin.modules.weichat.handler.*;
|
||||
import com.starry.admin.modules.weichat.utils.WxMpPropertiesUtils;
|
||||
import lombok.AllArgsConstructor;
|
||||
import me.chanjar.weixin.common.api.WxConsts;
|
||||
import me.chanjar.weixin.mp.api.WxMpMessageRouter;
|
||||
import me.chanjar.weixin.mp.api.WxMpService;
|
||||
import me.chanjar.weixin.mp.api.impl.WxMpServiceImpl;
|
||||
import me.chanjar.weixin.mp.config.WxMpConfigStorage;
|
||||
import me.chanjar.weixin.mp.config.impl.WxMpDefaultConfigImpl;
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import static me.chanjar.weixin.common.api.WxConsts.EventType.SUBSCRIBE;
|
||||
import static me.chanjar.weixin.common.api.WxConsts.EventType.UNSUBSCRIBE;
|
||||
@@ -29,7 +31,6 @@ import static me.chanjar.weixin.mp.constant.WxMpEventConstants.POI_CHECK_NOTIFY;
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Configuration
|
||||
@EnableConfigurationProperties(WxMpProperties.class)
|
||||
public class WxMpConfiguration {
|
||||
private final LogHandler logHandler;
|
||||
private final NullHandler nullHandler;
|
||||
@@ -41,27 +42,28 @@ public class WxMpConfiguration {
|
||||
private final UnsubscribeHandler unsubscribeHandler;
|
||||
private final SubscribeHandler subscribeHandler;
|
||||
private final ScanHandler scanHandler;
|
||||
private final WxMpProperties properties;
|
||||
|
||||
@Bean
|
||||
public WxMpService wxMpService() {
|
||||
// 代码里 getConfigs()处报错的同学,请注意仔细阅读项目说明,你的IDE需要引入lombok插件!!!!
|
||||
final List<WxMpProperties.MpConfig> configs = this.properties.getConfigs();
|
||||
if (configs == null) {
|
||||
throw new RuntimeException("大哥,拜托先看下项目首页的说明(readme文件),添加下相关配置,注意别配错了!");
|
||||
CustomWxMpProperties customWxMpProperties = WxMpPropertiesUtils.getWeiChatProperties();
|
||||
if (StrUtil.isBlankIfStr(customWxMpProperties.getAppid()) || StrUtil.isBlankIfStr(customWxMpProperties.getAppid()) || StrUtil.isBlankIfStr(customWxMpProperties.getAppid()) || StrUtil.isBlankIfStr(customWxMpProperties.getAppid())) {
|
||||
throw new RuntimeException("微信配置文件出错");
|
||||
}
|
||||
return getWxMpService(customWxMpProperties);
|
||||
}
|
||||
|
||||
WxMpService service = new WxMpServiceImpl();
|
||||
service.setMultiConfigStorages(configs
|
||||
.stream().map(a -> {
|
||||
WxMpDefaultConfigImpl configStorage = new WxMpDefaultConfigImpl();
|
||||
configStorage.setAppId(a.getAppId());
|
||||
configStorage.setSecret(a.getSecret());
|
||||
configStorage.setToken(a.getToken());
|
||||
configStorage.setAesKey(a.getAesKey());
|
||||
return configStorage;
|
||||
}).collect(Collectors.toMap(WxMpDefaultConfigImpl::getAppId, a -> a, (o, n) -> o)));
|
||||
return service;
|
||||
private static WxMpService getWxMpService(CustomWxMpProperties customWxMpProperties) {
|
||||
Map<String, WxMpConfigStorage> multiConfigStorages = new HashMap<>(16);
|
||||
WxMpDefaultConfigImpl configStorage = new WxMpDefaultConfigImpl();
|
||||
configStorage.setAppId(customWxMpProperties.getAppid());
|
||||
configStorage.setSecret(customWxMpProperties.getSecret());
|
||||
configStorage.setToken(customWxMpProperties.getToken());
|
||||
configStorage.setAesKey(customWxMpProperties.getAesKey());
|
||||
|
||||
|
||||
WxMpService mpService = new WxMpServiceImpl();
|
||||
mpService.setMultiConfigStorages(multiConfigStorages);
|
||||
return mpService;
|
||||
}
|
||||
|
||||
@Bean
|
||||
@@ -72,12 +74,9 @@ public class WxMpConfiguration {
|
||||
newRouter.rule().handler(this.logHandler).next();
|
||||
|
||||
// 接收客服会话管理事件
|
||||
newRouter.rule().async(false).msgType(EVENT).event(KF_CREATE_SESSION)
|
||||
.handler(this.kfSessionHandler).end();
|
||||
newRouter.rule().async(false).msgType(EVENT).event(KF_CLOSE_SESSION)
|
||||
.handler(this.kfSessionHandler).end();
|
||||
newRouter.rule().async(false).msgType(EVENT).event(KF_SWITCH_SESSION)
|
||||
.handler(this.kfSessionHandler).end();
|
||||
newRouter.rule().async(false).msgType(EVENT).event(KF_CREATE_SESSION).handler(this.kfSessionHandler).end();
|
||||
newRouter.rule().async(false).msgType(EVENT).event(KF_CLOSE_SESSION).handler(this.kfSessionHandler).end();
|
||||
newRouter.rule().async(false).msgType(EVENT).event(KF_SWITCH_SESSION).handler(this.kfSessionHandler).end();
|
||||
|
||||
// 门店审核事件
|
||||
newRouter.rule().async(false).msgType(EVENT).event(POI_CHECK_NOTIFY).handler(this.storeCheckNotifyHandler).end();
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
package com.starry.weichat.constant;
|
||||
package com.starry.admin.modules.weichat.constant;
|
||||
|
||||
/**
|
||||
* 全局常量
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
package com.starry.weichat.constant;
|
||||
package com.starry.admin.modules.weichat.constant;
|
||||
|
||||
/**
|
||||
* 全局返回码
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
package com.starry.weichat.constant;
|
||||
package com.starry.admin.modules.weichat.constant;
|
||||
|
||||
/**
|
||||
* @author admin
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
package com.starry.weichat.constant;
|
||||
package com.starry.admin.modules.weichat.constant;
|
||||
|
||||
/**
|
||||
* @author admin
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.starry.weichat.constant;
|
||||
package com.starry.admin.modules.weichat.constant;
|
||||
|
||||
/**
|
||||
* 微信接口全局返回码
|
||||
@@ -1,13 +1,13 @@
|
||||
|
||||
package com.starry.weichat.controller;
|
||||
package com.starry.admin.modules.weichat.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.starry.admin.modules.weichat.constant.ConfigConstant;
|
||||
import com.starry.admin.modules.weichat.entity.WxAutoReply;
|
||||
import com.starry.admin.modules.weichat.service.WxAutoReplyService;
|
||||
import com.starry.common.result.R;
|
||||
import com.starry.weichat.constant.ConfigConstant;
|
||||
import com.starry.weichat.entity.WxAutoReply;
|
||||
import com.starry.weichat.service.WxAutoReplyService;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
@@ -28,7 +28,7 @@ import java.util.List;
|
||||
public class WxAutoReplyController {
|
||||
|
||||
@Resource
|
||||
WxAutoReplyService wxAutoReplyService;
|
||||
WxAutoReplyService wxAutoReplyService;
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
@@ -37,7 +37,7 @@ public class WxAutoReplyController {
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
@PreAuthorize("@customSs.hasPermi('wxmp:wxautoreply:index')")
|
||||
@PreAuthorize("@customSs.hasPermission('wxmp:wxautoreply:index')")
|
||||
public R getWxAutoReplyPage(Page page, WxAutoReply wxAutoReply) {
|
||||
return R.ok(wxAutoReplyService.page(page,Wrappers.query(wxAutoReply)));
|
||||
}
|
||||
@@ -49,7 +49,7 @@ public class WxAutoReplyController {
|
||||
* @return R
|
||||
*/
|
||||
@GetMapping("/{id}")
|
||||
@PreAuthorize("@customSs.hasPermi('wxmp:wxautoreply:get')")
|
||||
@PreAuthorize("@customSs.hasPermission('wxmp:wxautoreply:get')")
|
||||
public R getById(@PathVariable("id") String id){
|
||||
return R.ok(wxAutoReplyService.getById(id));
|
||||
}
|
||||
@@ -60,7 +60,7 @@ public class WxAutoReplyController {
|
||||
* @return R
|
||||
*/
|
||||
@PostMapping
|
||||
@PreAuthorize("@customSs.hasPermi('wxmp:wxautoreply:add')")
|
||||
@PreAuthorize("@customSs.hasPermission('wxmp:wxautoreply:add')")
|
||||
public R save(@RequestBody WxAutoReply wxAutoReply){
|
||||
this.jude(wxAutoReply);
|
||||
return R.ok(wxAutoReplyService.save(wxAutoReply));
|
||||
@@ -72,7 +72,7 @@ public class WxAutoReplyController {
|
||||
* @return R
|
||||
*/
|
||||
@PutMapping
|
||||
@PreAuthorize("@customSs.hasPermi('wxmp:wxautoreply:edit')")
|
||||
@PreAuthorize("@customSs.hasPermission('wxmp:wxautoreply:edit')")
|
||||
public R updateById(@RequestBody WxAutoReply wxAutoReply){
|
||||
this.jude(wxAutoReply);
|
||||
return R.ok(wxAutoReplyService.updateById(wxAutoReply));
|
||||
@@ -84,7 +84,7 @@ public class WxAutoReplyController {
|
||||
* @return R
|
||||
*/
|
||||
@DeleteMapping("/{id}")
|
||||
@PreAuthorize("@customSs.hasPermi('wxmp:wxautoreply:del')")
|
||||
@PreAuthorize("@customSs.hasPermission('wxmp:wxautoreply:del')")
|
||||
public R removeById(@PathVariable String id){
|
||||
return R.ok(wxAutoReplyService.removeById(id));
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
package com.starry.weichat.controller;
|
||||
package com.starry.admin.modules.weichat.controller;
|
||||
|
||||
import cn.hutool.json.JSONArray;
|
||||
import cn.hutool.json.JSONObject;
|
||||
@@ -45,7 +45,7 @@ public class WxDraftController {
|
||||
*/
|
||||
@ApiOperation(value = "新增草稿箱")
|
||||
@PostMapping
|
||||
@PreAuthorize("@customSs.hasPermi('wxmp:wxdraft:add')")
|
||||
@PreAuthorize("@customSs.hasPermission('wxmp:wxdraft:add')")
|
||||
public R add(@RequestBody JSONObject data) throws Exception {
|
||||
JSONArray jSONArray = data.getJSONArray("articles");
|
||||
List<WxMpDraftArticles> articles = jSONArray.toList(WxMpDraftArticles.class);
|
||||
@@ -64,7 +64,7 @@ public class WxDraftController {
|
||||
*/
|
||||
@ApiOperation(value = "修改微信草稿箱")
|
||||
@PutMapping
|
||||
@PreAuthorize("@customSs.hasPermi('wxmp:wxdraft:edit')")
|
||||
@PreAuthorize("@customSs.hasPermission('wxmp:wxdraft:edit')")
|
||||
public R edit(@RequestBody JSONObject data) throws Exception {
|
||||
String mediaId = data.getStr("mediaId");
|
||||
JSONArray jSONArray = data.getJSONArray("articles");
|
||||
@@ -90,7 +90,7 @@ public class WxDraftController {
|
||||
*/
|
||||
@ApiOperation(value = "通过id删除微信草稿箱")
|
||||
@DeleteMapping
|
||||
@PreAuthorize("@customSs.hasPermi('wxmp:wxdraft:del')")
|
||||
@PreAuthorize("@customSs.hasPermission('wxmp:wxdraft:del')")
|
||||
public R del(String id) throws Exception {
|
||||
WxMpDraftService wxMpDraftService = wxService.getDraftService();
|
||||
return R.ok(wxMpDraftService.delDraft(id));
|
||||
@@ -105,7 +105,7 @@ public class WxDraftController {
|
||||
*/
|
||||
@ApiOperation(value = "分页查询")
|
||||
@GetMapping("/page")
|
||||
@PreAuthorize("@customSs.hasPermi('wxmp:wxdraft:index')")
|
||||
@PreAuthorize("@customSs.hasPermission('wxmp:wxdraft:index')")
|
||||
public R getPage(Page page) throws Exception {
|
||||
WxMpDraftService wxMpDraftService = wxService.getDraftService();
|
||||
int count = (int) page.getSize();
|
||||
@@ -120,7 +120,7 @@ public class WxDraftController {
|
||||
*/
|
||||
@ApiOperation(value = "发布草稿箱")
|
||||
@PostMapping("/publish/{id}")
|
||||
@PreAuthorize("@customSs.hasPermi('wxmp:wxdraft:publish')")
|
||||
@PreAuthorize("@customSs.hasPermission('wxmp:wxdraft:publish')")
|
||||
public R publish(@PathVariable String id) throws Exception {
|
||||
WxMpFreePublishService wxMpFreePublishService = wxService.getFreePublishService();
|
||||
wxMpFreePublishService.submit(id);
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
package com.starry.weichat.controller;
|
||||
package com.starry.admin.modules.weichat.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.starry.common.result.R;
|
||||
@@ -41,7 +41,7 @@ public class WxFreePublishController {
|
||||
*/
|
||||
@ApiOperation(value = "删除发布")
|
||||
@DeleteMapping
|
||||
@PreAuthorize("@customSs.hasPermi('wxmp:wxfreepublish:del')")
|
||||
@PreAuthorize("@customSs.hasPermission('wxmp:wxfreepublish:del')")
|
||||
public R del(String id) throws Exception {
|
||||
WxMpFreePublishService wxMpFreePublishService = wxService.getFreePublishService();
|
||||
return R.ok(wxMpFreePublishService.deletePushAllArticle(id));
|
||||
@@ -56,7 +56,7 @@ public class WxFreePublishController {
|
||||
*/
|
||||
@ApiOperation(value = "获取成功发布列表")
|
||||
@GetMapping("/page")
|
||||
@PreAuthorize("@customSs.hasPermi('wxmp:wxfreepublish:index')")
|
||||
@PreAuthorize("@customSs.hasPermission('wxmp:wxfreepublish:index')")
|
||||
public R getPage(Page page) throws Exception {
|
||||
WxMpFreePublishService wxMpFreePublishService = wxService.getFreePublishService();
|
||||
int count = (int) page.getSize();
|
||||
@@ -1,11 +1,11 @@
|
||||
|
||||
package com.starry.weichat.controller;
|
||||
package com.starry.admin.modules.weichat.controller;
|
||||
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.starry.admin.modules.weichat.entity.ImageManager;
|
||||
import com.starry.admin.modules.weichat.utils.FileUtils;
|
||||
import com.starry.common.result.R;
|
||||
import com.starry.weichat.entity.ImageManager;
|
||||
import com.starry.weichat.utils.FileUtils;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import me.chanjar.weixin.common.api.WxConsts;
|
||||
@@ -55,7 +55,7 @@ public class WxMaterialController {
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/materialFileUpload")
|
||||
// @PreAuthorize("@customSs.hasPermi('wxmp:wxmaterial:add')")
|
||||
// @PreAuthorize("@customSs.hasPermission('wxmp:wxmaterial:add')")
|
||||
public R materialFileUpload(@RequestParam("file") MultipartFile mulFile,
|
||||
@RequestParam("title") String title,
|
||||
@RequestParam("introduction") String introduction,
|
||||
@@ -91,7 +91,7 @@ public class WxMaterialController {
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/newsImgUpload")
|
||||
// @PreAuthorize("@customSs.hasPermi('wxmp:wxmaterial:add')")
|
||||
// @PreAuthorize("@customSs.hasPermission('wxmp:wxmaterial:add')")
|
||||
public String newsImgUpload(@RequestParam("file") MultipartFile mulFile) throws Exception {
|
||||
File file = FileUtils.multipartFileToFile(mulFile);
|
||||
WxMpMaterialService wxMpMaterialService = wxService.getMaterialService();
|
||||
@@ -107,7 +107,7 @@ public class WxMaterialController {
|
||||
* @return R
|
||||
*/
|
||||
@DeleteMapping
|
||||
@PreAuthorize("@customSs.hasPermi('wxmp:wxmaterial:del')")
|
||||
@PreAuthorize("@customSs.hasPermission('wxmp:wxmaterial:del')")
|
||||
public R materialDel(String id){
|
||||
WxMpMaterialService wxMpMaterialService = wxService.getMaterialService();
|
||||
try {
|
||||
@@ -126,7 +126,7 @@ public class WxMaterialController {
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
@PreAuthorize("@customSs.hasPermi('wxmp:wxmaterial:index')")
|
||||
@PreAuthorize("@customSs.hasPermission('wxmp:wxmaterial:index')")
|
||||
public R getWxMaterialPage(Page page, String type) {
|
||||
try {
|
||||
WxMpMaterialService wxMpMaterialService = wxService.getMaterialService();
|
||||
@@ -150,7 +150,7 @@ public class WxMaterialController {
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/page-manager")
|
||||
// @PreAuthorize("@customSs.hasPermi('wxmp:wxmaterial:index')")
|
||||
// @PreAuthorize("@customSs.hasPermission('wxmp:wxmaterial:index')")
|
||||
public String getWxMaterialPageManager(Integer count, Integer offset, String type) throws WxErrorException {
|
||||
List<ImageManager> listImageManager = new ArrayList<>();
|
||||
WxMpMaterialService wxMpMaterialService = wxService.getMaterialService();
|
||||
@@ -171,7 +171,7 @@ public class WxMaterialController {
|
||||
* @return R
|
||||
*/
|
||||
@GetMapping("/materialVideo")
|
||||
@PreAuthorize("@customSs.hasPermi('wxmp:wxmaterial:get')")
|
||||
@PreAuthorize("@customSs.hasPermission('wxmp:wxmaterial:get')")
|
||||
public R getMaterialVideo(String mediaId){
|
||||
WxMpMaterialService wxMpMaterialService = wxService.getMaterialService();
|
||||
try {
|
||||
@@ -189,7 +189,7 @@ public class WxMaterialController {
|
||||
* @return R
|
||||
*/
|
||||
@GetMapping("/materialOther")
|
||||
@PreAuthorize("@customSs.hasPermi('wxmp:wxmaterial:get')")
|
||||
@PreAuthorize("@customSs.hasPermission('wxmp:wxmaterial:get')")
|
||||
public ResponseEntity<byte[]> getMaterialOther(String mediaId, String fileName) throws Exception {
|
||||
try {
|
||||
WxMpMaterialService wxMpMaterialService = wxService.getMaterialService();
|
||||
@@ -217,7 +217,7 @@ public class WxMaterialController {
|
||||
* @return R
|
||||
*/
|
||||
@GetMapping("/tempMaterialOther")
|
||||
@PreAuthorize("@customSs.hasPermi('wxmp:wxmsg:index')")
|
||||
@PreAuthorize("@customSs.hasPermission('wxmp:wxmsg:index')")
|
||||
public ResponseEntity<byte[]> getTempMaterialOther(String mediaId, String fileName) throws Exception {
|
||||
WxMpMaterialService wxMpMaterialService = wxService.getMaterialService();
|
||||
try (InputStream is = Files.newInputStream(wxMpMaterialService.mediaDownload(mediaId).toPath())){
|
||||
@@ -1,10 +1,10 @@
|
||||
|
||||
package com.starry.weichat.controller;
|
||||
package com.starry.admin.modules.weichat.controller;
|
||||
|
||||
import cn.hutool.json.JSONObject;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.starry.admin.modules.weichat.service.WxMenuService;
|
||||
import com.starry.common.result.R;
|
||||
import com.starry.weichat.service.WxMenuService;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import me.chanjar.weixin.common.error.WxErrorException;
|
||||
@@ -26,7 +26,7 @@ import javax.annotation.Resource;
|
||||
public class WxMenuController {
|
||||
|
||||
@Resource
|
||||
WxMenuService wxMenuService;
|
||||
WxMenuService wxMenuService;
|
||||
|
||||
/**
|
||||
* 通过appId查询自定义菜单
|
||||
@@ -34,7 +34,7 @@ public class WxMenuController {
|
||||
* @return R
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
@PreAuthorize("@customSs.hasPermi('wxmp:wxmenu:get')")
|
||||
@PreAuthorize("@customSs.hasPermission('wxmp:wxmenu:get')")
|
||||
public R getWxMenuButton() {
|
||||
return R.ok(wxMenuService.getWxMenuButton());
|
||||
}
|
||||
@@ -46,7 +46,7 @@ public class WxMenuController {
|
||||
* @return R
|
||||
*/
|
||||
@PostMapping("/release")
|
||||
@PreAuthorize("@customSs.hasPermi('wxmp:wxmenu:add')")
|
||||
@PreAuthorize("@customSs.hasPermission('wxmp:wxmenu:add')")
|
||||
public R saveAndRelease(@RequestBody String data) {
|
||||
JSONObject jSONObject = JSONUtil.parseObj(data);
|
||||
String strWxMenu = jSONObject.getStr("strWxMenu");
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
package com.starry.weichat.controller;
|
||||
package com.starry.admin.modules.weichat.controller;
|
||||
|
||||
import cn.hutool.json.JSONArray;
|
||||
import cn.hutool.json.JSONObject;
|
||||
@@ -7,14 +7,14 @@ import cn.hutool.json.JSONUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.starry.admin.modules.weichat.config.CommonConstants;
|
||||
import com.starry.admin.modules.weichat.constant.ConfigConstant;
|
||||
import com.starry.admin.modules.weichat.entity.WxMsg;
|
||||
import com.starry.admin.modules.weichat.entity.WxMsgVO;
|
||||
import com.starry.admin.modules.weichat.entity.WxUser;
|
||||
import com.starry.admin.modules.weichat.service.WxMsgService;
|
||||
import com.starry.admin.modules.weichat.service.WxUserService;
|
||||
import com.starry.common.result.R;
|
||||
import com.starry.weichat.config.CommonConstants;
|
||||
import com.starry.weichat.constant.ConfigConstant;
|
||||
import com.starry.weichat.entity.WxMsg;
|
||||
import com.starry.weichat.entity.WxMsgVO;
|
||||
import com.starry.weichat.entity.WxUser;
|
||||
import com.starry.weichat.service.WxMsgService;
|
||||
import com.starry.weichat.service.WxUserService;
|
||||
import io.swagger.annotations.Api;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -62,7 +62,7 @@ public class WxMsgController {
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
@PreAuthorize("@customSs.hasPermi('wxmp:wxmsg:index')")
|
||||
@PreAuthorize("@customSs.hasPermission('wxmp:wxmsg:index')")
|
||||
public R getWxMsgPage(Page<WxMsg> page, WxMsgVO wxMsgVO) {
|
||||
if (StringUtils.isNotBlank(wxMsgVO.getNotInRepType())) {
|
||||
return R.ok(wxMsgService.listWxMsgMapGroup(page, wxMsgVO));
|
||||
@@ -84,7 +84,7 @@ public class WxMsgController {
|
||||
* @return R
|
||||
*/
|
||||
@GetMapping("/{id}")
|
||||
@PreAuthorize("@customSs.hasPermi('wxmp:wxmsg:get')")
|
||||
@PreAuthorize("@customSs.hasPermission('wxmp:wxmsg:get')")
|
||||
public R getById(@PathVariable("id") String id) {
|
||||
return R.ok(wxMsgService.getById(id));
|
||||
}
|
||||
@@ -96,7 +96,7 @@ public class WxMsgController {
|
||||
* @return R
|
||||
*/
|
||||
@PostMapping
|
||||
@PreAuthorize("@customSs.hasPermi('wxmp:wxmsg:add')")
|
||||
@PreAuthorize("@customSs.hasPermission('wxmp:wxmsg:add')")
|
||||
public R save(@RequestBody WxMsg wxMsg) {
|
||||
try {
|
||||
WxUser wxUser = wxUserService.getById(wxMsg.getWxUserId());
|
||||
@@ -190,7 +190,7 @@ public class WxMsgController {
|
||||
* @return R
|
||||
*/
|
||||
@PutMapping
|
||||
@PreAuthorize("@customSs.hasPermi('wxmp:wxmsg:edit')")
|
||||
@PreAuthorize("@customSs.hasPermission('wxmp:wxmsg:edit')")
|
||||
public R updateById(@RequestBody WxMsg wxMsg) {
|
||||
return R.ok(wxMsgService.updateById(wxMsg));
|
||||
}
|
||||
@@ -202,7 +202,7 @@ public class WxMsgController {
|
||||
* @return R
|
||||
*/
|
||||
@DeleteMapping("/{id}")
|
||||
@PreAuthorize("@customSs.hasPermi('wxmp:wxmsg:del')")
|
||||
@PreAuthorize("@customSs.hasPermission('wxmp:wxmsg:del')")
|
||||
public R removeById(@PathVariable String id) {
|
||||
return R.ok(wxMsgService.removeById(id));
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
package com.starry.weichat.controller;
|
||||
package com.starry.admin.modules.weichat.controller;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
package com.starry.weichat.controller;
|
||||
package com.starry.admin.modules.weichat.controller;
|
||||
|
||||
import com.starry.common.result.R;
|
||||
import lombok.AllArgsConstructor;
|
||||
@@ -38,7 +38,7 @@ public class WxSummaryController {
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/usersummary")
|
||||
// @PreAuthorize("@customSs.hasPermi('wxmp:wxsummary:index')")
|
||||
// @PreAuthorize("@customSs.hasPermission('wxmp:wxsummary:index')")
|
||||
public R getUsersummary(String appId, String startDate, String endDate) {
|
||||
try {
|
||||
WxMpDataCubeService wxMpDataCubeService = wxService.getDataCubeService();
|
||||
@@ -64,7 +64,7 @@ public class WxSummaryController {
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/usercumulate")
|
||||
// @PreAuthorize("@customSs.hasPermi('wxmp:wxsummary:index')")
|
||||
// @PreAuthorize("@customSs.hasPermission('wxmp:wxsummary:index')")
|
||||
public R getUserCumulate(String appId, String startDate, String endDate) {
|
||||
try {
|
||||
WxMpDataCubeService wxMpDataCubeService = wxService.getDataCubeService();
|
||||
@@ -90,7 +90,7 @@ public class WxSummaryController {
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/interfacesummary")
|
||||
// @PreAuthorize("@customSs.hasPermi('wxmp:wxsummary:index')")
|
||||
// @PreAuthorize("@customSs.hasPermission('wxmp:wxsummary:index')")
|
||||
public R getInterfaceSummary(String appId, String startDate, String endDate) {
|
||||
try {
|
||||
WxMpDataCubeService wxMpDataCubeService = wxService.getDataCubeService();
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
package com.starry.weichat.controller;
|
||||
package com.starry.admin.modules.weichat.controller;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONArray;
|
||||
@@ -7,9 +7,9 @@ import cn.hutool.json.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.starry.admin.modules.weichat.entity.WxUser;
|
||||
import com.starry.admin.modules.weichat.service.WxUserService;
|
||||
import com.starry.common.result.R;
|
||||
import com.starry.weichat.entity.WxUser;
|
||||
import com.starry.weichat.service.WxUserService;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import me.chanjar.weixin.common.error.WxErrorException;
|
||||
@@ -42,7 +42,7 @@ public class WxUserController {
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
@PreAuthorize("@customSs.hasPermi('wxmp:wxuser:index')")
|
||||
@PreAuthorize("@customSs.hasPermission('wxmp:wxuser:index')")
|
||||
public R getWxUserPage(Page page, WxUser wxUser, String tagId) {
|
||||
Wrapper<WxUser> queryWrapper;
|
||||
if (StringUtils.isNotBlank(tagId)) {
|
||||
@@ -74,7 +74,7 @@ public class WxUserController {
|
||||
* @return R
|
||||
*/
|
||||
@GetMapping("/{id}")
|
||||
@PreAuthorize("@customSs.hasPermi('wxmp:wxuser:get')")
|
||||
@PreAuthorize("@customSs.hasPermission('wxmp:wxuser:get')")
|
||||
public R getById(@PathVariable("id") String id) {
|
||||
return R.ok(wxUserService.getById(id));
|
||||
}
|
||||
@@ -86,7 +86,7 @@ public class WxUserController {
|
||||
* @return R
|
||||
*/
|
||||
@PostMapping
|
||||
@PreAuthorize("@customSs.hasPermi('wxmp:wxuser:add')")
|
||||
@PreAuthorize("@customSs.hasPermission('wxmp:wxuser:add')")
|
||||
public R save(@RequestBody WxUser wxUser) {
|
||||
return R.ok(wxUserService.save(wxUser));
|
||||
}
|
||||
@@ -98,7 +98,7 @@ public class WxUserController {
|
||||
* @return R
|
||||
*/
|
||||
@PutMapping
|
||||
@PreAuthorize("@customSs.hasPermi('wxmp:wxuser:edit')")
|
||||
@PreAuthorize("@customSs.hasPermission('wxmp:wxuser:edit')")
|
||||
public R updateById(@RequestBody WxUser wxUser) {
|
||||
return R.ok(wxUserService.updateById(wxUser));
|
||||
}
|
||||
@@ -110,13 +110,13 @@ public class WxUserController {
|
||||
* @return R
|
||||
*/
|
||||
@DeleteMapping("/{id}")
|
||||
@PreAuthorize("@customSs.hasPermi('wxmp:wxuser:del')")
|
||||
@PreAuthorize("@customSs.hasPermission('wxmp:wxuser:del')")
|
||||
public R removeById(@PathVariable String id) {
|
||||
return R.ok(wxUserService.removeById(id));
|
||||
}
|
||||
|
||||
@PostMapping("/synchron")
|
||||
@PreAuthorize("@customSs.hasPermi('wxmp:wxuser:synchro')")
|
||||
@PreAuthorize("@customSs.hasPermission('wxmp:wxuser:synchro')")
|
||||
public R synchron() {
|
||||
try {
|
||||
wxUserService.synchroWxUser();
|
||||
@@ -135,7 +135,7 @@ public class WxUserController {
|
||||
* @return
|
||||
*/
|
||||
@PutMapping("/remark")
|
||||
@PreAuthorize("@customSs.hasPermi('wxmp:wxuser:edit:remark')")
|
||||
@PreAuthorize("@customSs.hasPermission('wxmp:wxuser:edit:remark')")
|
||||
public R remark(@RequestBody WxUser wxUser) {
|
||||
try {
|
||||
return R.ok(wxUserService.updateRemark(wxUser));
|
||||
@@ -153,7 +153,7 @@ public class WxUserController {
|
||||
* @return
|
||||
*/
|
||||
@PutMapping("/tagid-list")
|
||||
@PreAuthorize("@customSs.hasPermi('wxmp:wxuser:tagging')")
|
||||
@PreAuthorize("@customSs.hasPermission('wxmp:wxuser:tagging')")
|
||||
public R tagidList(@RequestBody JSONObject data) {
|
||||
try {
|
||||
String appId = data.getStr("appId");
|
||||
@@ -1,12 +1,12 @@
|
||||
|
||||
package com.starry.weichat.controller;
|
||||
package com.starry.admin.modules.weichat.controller;
|
||||
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.starry.admin.modules.weichat.entity.WxUser;
|
||||
import com.starry.admin.modules.weichat.entity.WxUserTagsDict;
|
||||
import com.starry.admin.modules.weichat.service.WxUserService;
|
||||
import com.starry.common.result.R;
|
||||
import com.starry.weichat.entity.WxUser;
|
||||
import com.starry.weichat.entity.WxUserTagsDict;
|
||||
import com.starry.weichat.service.WxUserService;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import me.chanjar.weixin.common.error.WxErrorException;
|
||||
@@ -36,13 +36,13 @@ public class WxUserTagsController {
|
||||
WxMpService wxService;
|
||||
|
||||
@Resource
|
||||
WxUserService wxUserService;
|
||||
WxUserService wxUserService;
|
||||
|
||||
/**
|
||||
* 获取微信用户标签
|
||||
* @return
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermi('wxmp:wxusertags:list')")
|
||||
@PreAuthorize("@customSs.hasPermission('wxmp:wxusertags:list')")
|
||||
@GetMapping("/list")
|
||||
public R getWxUserList(String appId) {
|
||||
WxMpUserTagService wxMpUserTagService = wxService.getUserTagService();
|
||||
@@ -61,7 +61,7 @@ public class WxUserTagsController {
|
||||
* @param appId
|
||||
* @return
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermi('wxmp:wxusertags:list')")
|
||||
@PreAuthorize("@customSs.hasPermission('wxmp:wxusertags:list')")
|
||||
@GetMapping("/dict")
|
||||
public R getWxUserTagsDict(String appId) {
|
||||
WxMpUserTagService wxMpUserTagService = wxService.getUserTagService();
|
||||
@@ -87,7 +87,7 @@ public class WxUserTagsController {
|
||||
* 新增微信用户标签
|
||||
* @return
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermi('wxmp:wxusertags:add')")
|
||||
@PreAuthorize("@customSs.hasPermission('wxmp:wxusertags:add')")
|
||||
@PostMapping
|
||||
public R save(@RequestBody JSONObject data){
|
||||
String appId = data.getStr("appId");
|
||||
@@ -106,7 +106,7 @@ public class WxUserTagsController {
|
||||
* 修改微信用户标签
|
||||
* @return
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermi('wxmp:wxusertags:edit')")
|
||||
@PreAuthorize("@customSs.hasPermission('wxmp:wxusertags:edit')")
|
||||
@PutMapping
|
||||
public R updateById(@RequestBody JSONObject data){
|
||||
String appId = data.getStr("appId");
|
||||
@@ -128,7 +128,7 @@ public class WxUserTagsController {
|
||||
* @param appId
|
||||
* @return
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermi('wxmp:wxusertags:del')")
|
||||
@PreAuthorize("@customSs.hasPermission('wxmp:wxusertags:del')")
|
||||
@DeleteMapping
|
||||
public R removeById(Long id,String appId){
|
||||
int count = (int) wxUserService.count(Wrappers.<WxUser>lambdaQuery()
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.starry.admin.modules.weichat.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class CustomWxMpProperties {
|
||||
|
||||
/**
|
||||
* 微信APPID
|
||||
*/
|
||||
public String appid;
|
||||
|
||||
/**
|
||||
* 微信公众号的app secret
|
||||
*/
|
||||
public String secret;
|
||||
|
||||
/**
|
||||
* 微信公众号的token
|
||||
*/
|
||||
public String token;
|
||||
|
||||
/**
|
||||
* 微信公众号的EncodingAESKey
|
||||
*/
|
||||
public String aesKey;
|
||||
|
||||
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
package com.starry.weichat.entity;
|
||||
package com.starry.admin.modules.weichat.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
package com.starry.weichat.entity;
|
||||
package com.starry.admin.modules.weichat.entity;
|
||||
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import lombok.Data;
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
package com.starry.weichat.entity;
|
||||
package com.starry.admin.modules.weichat.entity;
|
||||
|
||||
import cn.hutool.json.JSONObject;
|
||||
import lombok.Data;
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
package com.starry.weichat.entity;
|
||||
package com.starry.admin.modules.weichat.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
package com.starry.weichat.entity;
|
||||
package com.starry.admin.modules.weichat.entity;
|
||||
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
package com.starry.weichat.entity;
|
||||
package com.starry.admin.modules.weichat.entity;
|
||||
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
package com.starry.weichat.entity;
|
||||
package com.starry.admin.modules.weichat.entity;
|
||||
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
package com.starry.weichat.entity;
|
||||
package com.starry.admin.modules.weichat.entity;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.starry.weichat.entity;
|
||||
package com.starry.admin.modules.weichat.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
package com.starry.weichat.entity;
|
||||
package com.starry.admin.modules.weichat.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
package com.starry.weichat.entity;
|
||||
package com.starry.admin.modules.weichat.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
package com.starry.weichat.handler;
|
||||
package com.starry.admin.modules.weichat.handler;
|
||||
|
||||
import me.chanjar.weixin.mp.api.WxMpMessageHandler;
|
||||
import org.slf4j.Logger;
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
package com.starry.weichat.handler;
|
||||
package com.starry.admin.modules.weichat.handler;
|
||||
|
||||
import me.chanjar.weixin.common.session.WxSessionManager;
|
||||
import me.chanjar.weixin.mp.api.WxMpService;
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
package com.starry.weichat.handler;
|
||||
package com.starry.admin.modules.weichat.handler;
|
||||
|
||||
import com.starry.weichat.builder.TextBuilder;
|
||||
import com.starry.admin.modules.weichat.builder.TextBuilder;
|
||||
import me.chanjar.weixin.common.session.WxSessionManager;
|
||||
import me.chanjar.weixin.mp.api.WxMpService;
|
||||
import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage;
|
||||
@@ -1,9 +1,9 @@
|
||||
|
||||
package com.starry.weichat.handler;
|
||||
package com.starry.admin.modules.weichat.handler;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.starry.admin.modules.weichat.utils.JsonUtils;
|
||||
import com.starry.common.utils.HttpUtils;
|
||||
import com.starry.weichat.utils.JsonUtils;
|
||||
import me.chanjar.weixin.common.api.WxConsts;
|
||||
import me.chanjar.weixin.common.session.WxSessionManager;
|
||||
import me.chanjar.weixin.mp.api.WxMpService;
|
||||
@@ -1,17 +1,17 @@
|
||||
|
||||
package com.starry.weichat.handler;
|
||||
package com.starry.admin.modules.weichat.handler;
|
||||
|
||||
import cn.hutool.json.JSONObject;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.starry.weichat.config.CommonConstants;
|
||||
import com.starry.weichat.constant.ConfigConstant;
|
||||
import com.starry.weichat.entity.WxMenu;
|
||||
import com.starry.weichat.entity.WxMsg;
|
||||
import com.starry.weichat.entity.WxUser;
|
||||
import com.starry.weichat.mapper.WxMenuMapper;
|
||||
import com.starry.weichat.mapper.WxMsgMapper;
|
||||
import com.starry.weichat.mapper.WxUserMapper;
|
||||
import com.starry.admin.modules.weichat.config.CommonConstants;
|
||||
import com.starry.admin.modules.weichat.constant.ConfigConstant;
|
||||
import com.starry.admin.modules.weichat.entity.WxMenu;
|
||||
import com.starry.admin.modules.weichat.entity.WxMsg;
|
||||
import com.starry.admin.modules.weichat.entity.WxUser;
|
||||
import com.starry.admin.modules.weichat.mapper.WxMenuMapper;
|
||||
import com.starry.admin.modules.weichat.mapper.WxMsgMapper;
|
||||
import com.starry.admin.modules.weichat.mapper.WxUserMapper;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import me.chanjar.weixin.common.api.WxConsts;
|
||||
@@ -1,17 +1,17 @@
|
||||
|
||||
package com.starry.weichat.handler;
|
||||
package com.starry.admin.modules.weichat.handler;
|
||||
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.starry.weichat.config.CommonConstants;
|
||||
import com.starry.weichat.constant.ConfigConstant;
|
||||
import com.starry.weichat.constant.WebSocketConstant;
|
||||
import com.starry.weichat.entity.WxAutoReply;
|
||||
import com.starry.weichat.entity.WxMsg;
|
||||
import com.starry.weichat.entity.WxUser;
|
||||
import com.starry.weichat.mapper.WxUserMapper;
|
||||
import com.starry.weichat.service.WxAutoReplyService;
|
||||
import com.starry.weichat.service.WxMsgService;
|
||||
import com.starry.admin.modules.weichat.config.CommonConstants;
|
||||
import com.starry.admin.modules.weichat.constant.ConfigConstant;
|
||||
import com.starry.admin.modules.weichat.constant.WebSocketConstant;
|
||||
import com.starry.admin.modules.weichat.entity.WxAutoReply;
|
||||
import com.starry.admin.modules.weichat.entity.WxMsg;
|
||||
import com.starry.admin.modules.weichat.entity.WxUser;
|
||||
import com.starry.admin.modules.weichat.mapper.WxUserMapper;
|
||||
import com.starry.admin.modules.weichat.service.WxAutoReplyService;
|
||||
import com.starry.admin.modules.weichat.service.WxMsgService;
|
||||
import lombok.AllArgsConstructor;
|
||||
import me.chanjar.weixin.common.api.WxConsts;
|
||||
import me.chanjar.weixin.common.session.WxSessionManager;
|
||||
@@ -58,17 +58,17 @@ public class MsgHandler extends AbstractHandler {
|
||||
wxMsg.setRepEvent(wxMessage.getEvent());
|
||||
wxMsg.setRepType(wxMessage.getMsgType());
|
||||
wxMsg.setRepMediaId(wxMessage.getMediaId());
|
||||
if (WxConsts.XmlMsgType.TEXT.equals(wxMessage.getMsgType())) {
|
||||
if (XmlMsgType.TEXT.equals(wxMessage.getMsgType())) {
|
||||
wxMsg.setRepContent(wxMessage.getContent());
|
||||
}
|
||||
if (WxConsts.XmlMsgType.VOICE.equals(wxMessage.getMsgType())) {
|
||||
if (XmlMsgType.VOICE.equals(wxMessage.getMsgType())) {
|
||||
wxMsg.setRepName(wxMessage.getMediaId() + "." + wxMessage.getFormat());
|
||||
wxMsg.setRepContent(wxMessage.getRecognition());
|
||||
}
|
||||
if (WxConsts.XmlMsgType.IMAGE.equals(wxMessage.getMsgType())) {
|
||||
if (XmlMsgType.IMAGE.equals(wxMessage.getMsgType())) {
|
||||
wxMsg.setRepUrl(wxMessage.getPicUrl());
|
||||
}
|
||||
if (WxConsts.XmlMsgType.LINK.equals(wxMessage.getMsgType())) {
|
||||
if (XmlMsgType.LINK.equals(wxMessage.getMsgType())) {
|
||||
wxMsg.setRepName(wxMessage.getTitle());
|
||||
wxMsg.setRepDesc(wxMessage.getDescription());
|
||||
wxMsg.setRepUrl(wxMessage.getUrl());
|
||||
@@ -77,10 +77,10 @@ public class MsgHandler extends AbstractHandler {
|
||||
wxMsg.setRepName(wxMessage.getTitle());
|
||||
wxMsg.setRepDesc(wxMessage.getDescription());
|
||||
}
|
||||
if (WxConsts.XmlMsgType.VIDEO.equals(wxMessage.getMsgType())) {
|
||||
if (XmlMsgType.VIDEO.equals(wxMessage.getMsgType())) {
|
||||
wxMsg.setRepThumbMediaId(wxMessage.getThumbMediaId());
|
||||
}
|
||||
if (WxConsts.XmlMsgType.LOCATION.equals(wxMessage.getMsgType())) {
|
||||
if (XmlMsgType.LOCATION.equals(wxMessage.getMsgType())) {
|
||||
wxMsg.setRepLocationX(wxMessage.getLocationX());
|
||||
wxMsg.setRepLocationY(wxMessage.getLocationY());
|
||||
wxMsg.setRepScale(wxMessage.getScale());
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
package com.starry.weichat.handler;
|
||||
package com.starry.admin.modules.weichat.handler;
|
||||
|
||||
import me.chanjar.weixin.common.session.WxSessionManager;
|
||||
import me.chanjar.weixin.mp.api.WxMpService;
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
package com.starry.weichat.handler;
|
||||
package com.starry.admin.modules.weichat.handler;
|
||||
|
||||
import me.chanjar.weixin.common.error.WxErrorException;
|
||||
import me.chanjar.weixin.common.session.WxSessionManager;
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
package com.starry.weichat.handler;
|
||||
package com.starry.admin.modules.weichat.handler;
|
||||
|
||||
import me.chanjar.weixin.common.session.WxSessionManager;
|
||||
import me.chanjar.weixin.mp.api.WxMpService;
|
||||
@@ -1,15 +1,15 @@
|
||||
|
||||
package com.starry.weichat.handler;
|
||||
package com.starry.admin.modules.weichat.handler;
|
||||
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.starry.weichat.constant.ConfigConstant;
|
||||
import com.starry.weichat.entity.WxAutoReply;
|
||||
import com.starry.weichat.entity.WxUser;
|
||||
import com.starry.weichat.mapper.WxUserMapper;
|
||||
import com.starry.weichat.service.WxAutoReplyService;
|
||||
import com.starry.weichat.service.WxMsgService;
|
||||
import com.starry.weichat.utils.LocalDateTimeUtils;
|
||||
import com.starry.admin.modules.weichat.constant.ConfigConstant;
|
||||
import com.starry.admin.modules.weichat.entity.WxAutoReply;
|
||||
import com.starry.admin.modules.weichat.entity.WxUser;
|
||||
import com.starry.admin.modules.weichat.mapper.WxUserMapper;
|
||||
import com.starry.admin.modules.weichat.service.WxAutoReplyService;
|
||||
import com.starry.admin.modules.weichat.service.WxMsgService;
|
||||
import com.starry.admin.modules.weichat.utils.LocalDateTimeUtils;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import me.chanjar.weixin.common.session.WxSessionManager;
|
||||
@@ -1,11 +1,11 @@
|
||||
|
||||
package com.starry.weichat.handler;
|
||||
package com.starry.admin.modules.weichat.handler;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.starry.weichat.constant.ConfigConstant;
|
||||
import com.starry.weichat.entity.WxUser;
|
||||
import com.starry.weichat.mapper.WxUserMapper;
|
||||
import com.starry.weichat.service.WxMsgService;
|
||||
import com.starry.admin.modules.weichat.constant.ConfigConstant;
|
||||
import com.starry.admin.modules.weichat.entity.WxUser;
|
||||
import com.starry.admin.modules.weichat.mapper.WxUserMapper;
|
||||
import com.starry.admin.modules.weichat.service.WxMsgService;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import me.chanjar.weixin.common.session.WxSessionManager;
|
||||
@@ -1,14 +1,14 @@
|
||||
package com.starry.weichat.interceptor;
|
||||
package com.starry.admin.modules.weichat.interceptor;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.starry.admin.modules.weichat.config.CommonConstants;
|
||||
import com.starry.admin.modules.weichat.constant.ConfigConstant;
|
||||
import com.starry.admin.modules.weichat.constant.MyReturnCode;
|
||||
import com.starry.admin.modules.weichat.constant.WxMaConstants;
|
||||
import com.starry.admin.modules.weichat.entity.ThirdSession;
|
||||
import com.starry.admin.modules.weichat.utils.ThirdSessionHolder;
|
||||
import com.starry.common.result.R;
|
||||
import com.starry.weichat.config.CommonConstants;
|
||||
import com.starry.weichat.constant.ConfigConstant;
|
||||
import com.starry.weichat.constant.MyReturnCode;
|
||||
import com.starry.weichat.constant.WxMaConstants;
|
||||
import com.starry.weichat.entity.ThirdSession;
|
||||
import com.starry.weichat.utils.ThirdSessionHolder;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.http.MediaType;
|
||||
@@ -1,9 +1,9 @@
|
||||
|
||||
package com.starry.weichat.mapper;
|
||||
package com.starry.admin.modules.weichat.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.starry.weichat.entity.WxAutoReply;
|
||||
import com.starry.admin.modules.weichat.entity.WxAutoReply;
|
||||
|
||||
/**
|
||||
* 消息自动回复
|
||||
@@ -1,8 +1,8 @@
|
||||
|
||||
package com.starry.weichat.mapper;
|
||||
package com.starry.admin.modules.weichat.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.starry.weichat.entity.WxMenu;
|
||||
import com.starry.admin.modules.weichat.entity.WxMenu;
|
||||
|
||||
/**
|
||||
* 自定义菜单
|
||||
@@ -1,12 +1,12 @@
|
||||
|
||||
package com.starry.weichat.mapper;
|
||||
package com.starry.admin.modules.weichat.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.starry.weichat.entity.WxMsg;
|
||||
import com.starry.weichat.entity.WxMsgVO;
|
||||
import com.starry.admin.modules.weichat.entity.WxMsg;
|
||||
import com.starry.admin.modules.weichat.entity.WxMsgVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
@@ -1,8 +1,8 @@
|
||||
|
||||
package com.starry.weichat.mapper;
|
||||
package com.starry.admin.modules.weichat.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.starry.weichat.entity.WxUser;
|
||||
import com.starry.admin.modules.weichat.entity.WxUser;
|
||||
|
||||
/**
|
||||
* 微信用户
|
||||
@@ -1,8 +1,8 @@
|
||||
|
||||
package com.starry.weichat.service;
|
||||
package com.starry.admin.modules.weichat.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.starry.weichat.entity.WxAutoReply;
|
||||
import com.starry.admin.modules.weichat.entity.WxAutoReply;
|
||||
|
||||
/**
|
||||
* 消息自动回复
|
||||
@@ -1,8 +1,8 @@
|
||||
|
||||
package com.starry.weichat.service;
|
||||
package com.starry.admin.modules.weichat.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.starry.weichat.entity.WxMenu;
|
||||
import com.starry.admin.modules.weichat.entity.WxMenu;
|
||||
import me.chanjar.weixin.common.error.WxErrorException;
|
||||
|
||||
/**
|
||||
@@ -1,11 +1,11 @@
|
||||
|
||||
package com.starry.weichat.service;
|
||||
package com.starry.admin.modules.weichat.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.starry.weichat.entity.WxMsg;
|
||||
import com.starry.weichat.entity.WxMsgVO;
|
||||
import com.starry.admin.modules.weichat.entity.WxMsg;
|
||||
import com.starry.admin.modules.weichat.entity.WxMsgVO;
|
||||
|
||||
/**
|
||||
* 微信消息
|
||||
@@ -1,9 +1,7 @@
|
||||
|
||||
package com.starry.weichat.service;
|
||||
package com.starry.admin.modules.weichat.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.starry.weichat.entity.WxOpenDataDTO;
|
||||
import com.starry.weichat.entity.WxUser;
|
||||
import com.starry.admin.modules.weichat.entity.WxUser;
|
||||
import me.chanjar.weixin.common.error.WxErrorException;
|
||||
|
||||
/**
|
||||
@@ -44,21 +42,5 @@ public interface WxUserService extends IService<WxUser> {
|
||||
* @return
|
||||
*/
|
||||
WxUser getByOpenId(String openId);
|
||||
|
||||
/**
|
||||
* 小程序登录
|
||||
*
|
||||
* @param appId
|
||||
* @param jsCode
|
||||
* @return
|
||||
*/
|
||||
WxUser loginMa(String appId, String jsCode) throws WxErrorException;
|
||||
|
||||
/**
|
||||
* 新增、更新微信用户
|
||||
*
|
||||
* @param wxOpenDataDTO
|
||||
* @return
|
||||
*/
|
||||
WxUser saveOrUptateWxUser(WxOpenDataDTO wxOpenDataDTO);
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
|
||||
package com.starry.weichat.service.impl;
|
||||
package com.starry.admin.modules.weichat.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.starry.weichat.entity.WxAutoReply;
|
||||
import com.starry.weichat.mapper.WxAutoReplyMapper;
|
||||
import com.starry.weichat.service.WxAutoReplyService;
|
||||
import com.starry.admin.modules.weichat.entity.WxAutoReply;
|
||||
import com.starry.admin.modules.weichat.mapper.WxAutoReplyMapper;
|
||||
import com.starry.admin.modules.weichat.service.WxAutoReplyService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
@@ -1,14 +1,14 @@
|
||||
|
||||
package com.starry.weichat.service.impl;
|
||||
package com.starry.admin.modules.weichat.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.starry.weichat.config.CommonConstants;
|
||||
import com.starry.weichat.entity.Menu;
|
||||
import com.starry.weichat.entity.MenuButton;
|
||||
import com.starry.weichat.entity.WxMenu;
|
||||
import com.starry.weichat.mapper.WxMenuMapper;
|
||||
import com.starry.weichat.service.WxMenuService;
|
||||
import com.starry.admin.modules.weichat.config.CommonConstants;
|
||||
import com.starry.admin.modules.weichat.entity.Menu;
|
||||
import com.starry.admin.modules.weichat.entity.MenuButton;
|
||||
import com.starry.admin.modules.weichat.entity.WxMenu;
|
||||
import com.starry.admin.modules.weichat.mapper.WxMenuMapper;
|
||||
import com.starry.admin.modules.weichat.service.WxMenuService;
|
||||
import lombok.AllArgsConstructor;
|
||||
import me.chanjar.weixin.common.error.WxErrorException;
|
||||
import me.chanjar.weixin.mp.api.WxMpService;
|
||||
@@ -1,13 +1,13 @@
|
||||
|
||||
package com.starry.weichat.service.impl;
|
||||
package com.starry.admin.modules.weichat.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.starry.weichat.entity.WxMsg;
|
||||
import com.starry.weichat.entity.WxMsgVO;
|
||||
import com.starry.weichat.mapper.WxMsgMapper;
|
||||
import com.starry.weichat.service.WxMsgService;
|
||||
import com.starry.admin.modules.weichat.entity.WxMsg;
|
||||
import com.starry.admin.modules.weichat.entity.WxMsgVO;
|
||||
import com.starry.admin.modules.weichat.mapper.WxMsgMapper;
|
||||
import com.starry.admin.modules.weichat.service.WxMsgService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user