Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
fc8adc5734
|
|
@ -40,7 +40,7 @@ public class MenuController {
|
||||||
* @return 菜单结构
|
* @return 菜单结构
|
||||||
*/
|
*/
|
||||||
@SaAdminCheckRole("管理员")
|
@SaAdminCheckRole("管理员")
|
||||||
// @SaAdminCheckPermission("menu:list")
|
@SaAdminCheckPermission(value = "menu:list", name = "菜单列表")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public CzgResult<List<MenuVO>> all(String title, String startTime, String endTime) {
|
public CzgResult<List<MenuVO>> all(String title, String startTime, String endTime) {
|
||||||
return CzgResult.success(menuService.getAll(title, startTime, endTime));
|
return CzgResult.success(menuService.getAll(title, startTime, endTime));
|
||||||
|
|
@ -51,7 +51,7 @@ public class MenuController {
|
||||||
* @return 菜单结构
|
* @return 菜单结构
|
||||||
*/
|
*/
|
||||||
@SaAdminCheckRole("管理员")
|
@SaAdminCheckRole("管理员")
|
||||||
// @SaAdminCheckPermission("menu:detail")
|
@SaAdminCheckPermission(value = "menu:detail", name = "菜单详情")
|
||||||
@GetMapping("/detail")
|
@GetMapping("/detail")
|
||||||
public CzgResult<SysMenu> detail(@RequestParam Integer id) {
|
public CzgResult<SysMenu> detail(@RequestParam Integer id) {
|
||||||
return CzgResult.success(menuService.getById(id));
|
return CzgResult.success(menuService.getById(id));
|
||||||
|
|
@ -62,7 +62,7 @@ public class MenuController {
|
||||||
* @return 是否成功
|
* @return 是否成功
|
||||||
*/
|
*/
|
||||||
@SaAdminCheckRole("管理员")
|
@SaAdminCheckRole("管理员")
|
||||||
// @SaAdminCheckPermission("menu:add")
|
@SaAdminCheckPermission(value = "menu:add", name = "菜单添加")
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public CzgResult<Boolean> add(@RequestBody @Validated MenuAddDTO menuAddDTO) {
|
public CzgResult<Boolean> add(@RequestBody @Validated MenuAddDTO menuAddDTO) {
|
||||||
return CzgResult.success(menuService.add(menuAddDTO));
|
return CzgResult.success(menuService.add(menuAddDTO));
|
||||||
|
|
@ -73,7 +73,7 @@ public class MenuController {
|
||||||
* @return 是否成功
|
* @return 是否成功
|
||||||
*/
|
*/
|
||||||
@SaAdminCheckRole("管理员")
|
@SaAdminCheckRole("管理员")
|
||||||
// @SaAdminCheckPermission("menu:edit")
|
@SaAdminCheckPermission(value = "menu:edit", name = "菜单编辑")
|
||||||
@PutMapping()
|
@PutMapping()
|
||||||
public CzgResult<Boolean> edit(@RequestBody @Validated MenuEditDTO menuEditDTO) {
|
public CzgResult<Boolean> edit(@RequestBody @Validated MenuEditDTO menuEditDTO) {
|
||||||
return CzgResult.success(menuService.edit(menuEditDTO));
|
return CzgResult.success(menuService.edit(menuEditDTO));
|
||||||
|
|
@ -84,7 +84,7 @@ public class MenuController {
|
||||||
* @return 是否成功
|
* @return 是否成功
|
||||||
*/
|
*/
|
||||||
@SaAdminCheckRole("管理员")
|
@SaAdminCheckRole("管理员")
|
||||||
// @SaAdminCheckPermission("menu:del")
|
@SaAdminCheckPermission(value = "menu:del", name = "菜单删除")
|
||||||
@DeleteMapping()
|
@DeleteMapping()
|
||||||
public CzgResult<Boolean> edit(@RequestBody @Validated MenuDelDTO menuDelDTO) {
|
public CzgResult<Boolean> edit(@RequestBody @Validated MenuDelDTO menuDelDTO) {
|
||||||
return CzgResult.success(menuService.removeById(menuDelDTO.getId()));
|
return CzgResult.success(menuService.removeById(menuDelDTO.getId()));
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ public class RoleController {
|
||||||
@SaAdminCheckPermission(value = "role:list", name = "角色列表")
|
@SaAdminCheckPermission(value = "role:list", name = "角色列表")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public CzgResult<Page<SysRole>> getList(PageDTO pageDTO, String key, String startTime, String endTime) {
|
public CzgResult<Page<SysRole>> getList(PageDTO pageDTO, String key, String startTime, String endTime) {
|
||||||
return CzgResult.success(roleService.getList(pageDTO, key, startTime, endTime));
|
return CzgResult.success(roleService.getList(StpKit.USER.getShopId(), pageDTO, key, startTime, endTime));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -85,6 +85,9 @@ public class RoleController {
|
||||||
@SaAdminCheckPermission(value = "role:remove", name = "角色删除")
|
@SaAdminCheckPermission(value = "role:remove", name = "角色删除")
|
||||||
@DeleteMapping
|
@DeleteMapping
|
||||||
public CzgResult<Boolean> remove(@RequestBody @Validated RoleRemoveDTO roleRemoveDTO) {
|
public CzgResult<Boolean> remove(@RequestBody @Validated RoleRemoveDTO roleRemoveDTO) {
|
||||||
|
if (roleRemoveDTO.id() == 1L || roleRemoveDTO.id() == 2L) {
|
||||||
|
return CzgResult.failure("超级管理员角色不可删除");
|
||||||
|
}
|
||||||
return CzgResult.success(roleService.removeById(roleRemoveDTO.id()));
|
return CzgResult.success(roleService.removeById(roleRemoveDTO.id()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ public class ShopActivateController {
|
||||||
* 店铺充值活动列表
|
* 店铺充值活动列表
|
||||||
* 权限标识: activate:list
|
* 权限标识: activate:list
|
||||||
*/
|
*/
|
||||||
@SaAdminCheckPermission("activate:list")
|
@SaAdminCheckPermission(value = "activate:list", name = "店铺充值活动列表")
|
||||||
@GetMapping
|
@GetMapping
|
||||||
public CzgResult<List<ShopActivateDTO>> detail(@RequestParam(required = false) Long shopId) {
|
public CzgResult<List<ShopActivateDTO>> detail(@RequestParam(required = false) Long shopId) {
|
||||||
return CzgResult.success(shopActivateService.getList(shopId));
|
return CzgResult.success(shopActivateService.getList(shopId));
|
||||||
|
|
@ -38,7 +38,7 @@ public class ShopActivateController {
|
||||||
* 店铺充值活动新增
|
* 店铺充值活动新增
|
||||||
* 权限标识: activate:add
|
* 权限标识: activate:add
|
||||||
*/
|
*/
|
||||||
@SaAdminCheckPermission("activate:add")
|
@SaAdminCheckPermission(value = "activate:add", name = "店铺充值活动新增")
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public CzgResult<Boolean> add(@RequestBody @Validated ShopActivateDTO activateDTO) {
|
public CzgResult<Boolean> add(@RequestBody @Validated ShopActivateDTO activateDTO) {
|
||||||
activateDTO.setShopId(StpKit.USER.getShopId());
|
activateDTO.setShopId(StpKit.USER.getShopId());
|
||||||
|
|
@ -49,7 +49,7 @@ public class ShopActivateController {
|
||||||
* 店铺充值活动修改
|
* 店铺充值活动修改
|
||||||
* 权限标识: activate:edit
|
* 权限标识: activate:edit
|
||||||
*/
|
*/
|
||||||
@SaAdminCheckPermission("activate:edit")
|
@SaAdminCheckPermission(value = "activate:edit", name = "店铺充值活动修改")
|
||||||
@PutMapping
|
@PutMapping
|
||||||
public CzgResult<Boolean> edit(@RequestBody @Validated ShopActivateDTO activateDTO) {
|
public CzgResult<Boolean> edit(@RequestBody @Validated ShopActivateDTO activateDTO) {
|
||||||
return CzgResult.success(shopActivateService.edit(activateDTO));
|
return CzgResult.success(shopActivateService.edit(activateDTO));
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ public class ShopMerchantController {
|
||||||
* @return 支付信息
|
* @return 支付信息
|
||||||
*/
|
*/
|
||||||
@SaAdminCheckRole("管理员")
|
@SaAdminCheckRole("管理员")
|
||||||
@SaAdminCheckPermission("shopMerchant:detail")
|
@SaAdminCheckPermission(value = "shopMerchant:detail", name = "商户支付信息获取")
|
||||||
@GetMapping
|
@GetMapping
|
||||||
public CzgResult<ShopMerchant> detail() {
|
public CzgResult<ShopMerchant> detail() {
|
||||||
return CzgResult.success(shopMerchantService.detail());
|
return CzgResult.success(shopMerchantService.detail());
|
||||||
|
|
@ -38,7 +38,7 @@ public class ShopMerchantController {
|
||||||
* @return 是否成功
|
* @return 是否成功
|
||||||
*/
|
*/
|
||||||
@SaAdminCheckRole("管理员")
|
@SaAdminCheckRole("管理员")
|
||||||
@SaAdminCheckPermission("shopMerchant:edit")
|
@SaAdminCheckPermission(value = "shopMerchant:edit", name = "商户支付信息修改")
|
||||||
@PutMapping
|
@PutMapping
|
||||||
public CzgResult<Boolean> edit(@RequestBody @Validated ShopMerchantEditDTO shopMerchantEditDTO) {
|
public CzgResult<Boolean> edit(@RequestBody @Validated ShopMerchantEditDTO shopMerchantEditDTO) {
|
||||||
return CzgResult.success(shopMerchantService.edit(shopMerchantEditDTO));
|
return CzgResult.success(shopMerchantService.edit(shopMerchantEditDTO));
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ public class ShopPermissionController {
|
||||||
* 获取店铺权限列表
|
* 获取店铺权限列表
|
||||||
* @return 权限列表
|
* @return 权限列表
|
||||||
*/
|
*/
|
||||||
@SaAdminCheckPermission("shopPermission:list")
|
@SaAdminCheckPermission(value = "shopPermission:list", name = "店铺权限列表")
|
||||||
@GetMapping
|
@GetMapping
|
||||||
public CzgResult<List<ShopPermission>> getPermission() {
|
public CzgResult<List<ShopPermission>> getPermission() {
|
||||||
return CzgResult.success(shopPermissionService.getPermission());
|
return CzgResult.success(shopPermissionService.getPermission());
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ public class ShopTableAreaController {
|
||||||
* @param name 区域名称
|
* @param name 区域名称
|
||||||
* @return 是否成功
|
* @return 是否成功
|
||||||
*/
|
*/
|
||||||
@SaAdminCheckPermission("shopArea:list")
|
@SaAdminCheckPermission(value = "shopArea:list", name = "区域列表")
|
||||||
@GetMapping
|
@GetMapping
|
||||||
public CzgResult<Page<ShopTableArea>> list(String name) {
|
public CzgResult<Page<ShopTableArea>> list(String name) {
|
||||||
return CzgResult.success(shopTableAreaService.pageInfo(StpKit.USER.getShopId(), name));
|
return CzgResult.success(shopTableAreaService.pageInfo(StpKit.USER.getShopId(), name));
|
||||||
|
|
@ -40,7 +40,7 @@ public class ShopTableAreaController {
|
||||||
* 权限标识: shopArea:edit
|
* 权限标识: shopArea:edit
|
||||||
* @return 是否成功
|
* @return 是否成功
|
||||||
*/
|
*/
|
||||||
@SaAdminCheckPermission("shopArea:edit")
|
@SaAdminCheckPermission(value = "shopArea:edit", name = "区域修改")
|
||||||
@PutMapping
|
@PutMapping
|
||||||
public CzgResult<Boolean> edit(@RequestBody @Validated ShopAreaEditDTO shopAreaEditDTO) {
|
public CzgResult<Boolean> edit(@RequestBody @Validated ShopAreaEditDTO shopAreaEditDTO) {
|
||||||
return CzgResult.success(shopTableAreaService.edit(StpKit.USER.getShopId(), shopAreaEditDTO));
|
return CzgResult.success(shopTableAreaService.edit(StpKit.USER.getShopId(), shopAreaEditDTO));
|
||||||
|
|
@ -51,7 +51,7 @@ public class ShopTableAreaController {
|
||||||
* 权限标识: shopArea:del
|
* 权限标识: shopArea:del
|
||||||
* @return 是否成功
|
* @return 是否成功
|
||||||
*/
|
*/
|
||||||
@SaAdminCheckPermission("shopArea:del")
|
@SaAdminCheckPermission(value = "shopArea:del", name = "区域删除")
|
||||||
@DeleteMapping
|
@DeleteMapping
|
||||||
public CzgResult<Boolean> remove(@RequestBody @Validated ShopAreaEditDTO shopAreaEditDTO) {
|
public CzgResult<Boolean> remove(@RequestBody @Validated ShopAreaEditDTO shopAreaEditDTO) {
|
||||||
return CzgResult.success(shopTableAreaService.remove(new QueryWrapper().eq(ShopTableArea::getShopId, StpKit.USER.getShopId()).eq(ShopTableArea::getId, shopAreaEditDTO.getId())));
|
return CzgResult.success(shopTableAreaService.remove(new QueryWrapper().eq(ShopTableArea::getShopId, StpKit.USER.getShopId()).eq(ShopTableArea::getId, shopAreaEditDTO.getId())));
|
||||||
|
|
@ -62,7 +62,7 @@ public class ShopTableAreaController {
|
||||||
* 权限标识: shopArea:add
|
* 权限标识: shopArea:add
|
||||||
* @return 是否成功
|
* @return 是否成功
|
||||||
*/
|
*/
|
||||||
@SaAdminCheckPermission("shopArea:add")
|
@SaAdminCheckPermission(value = "shopArea:add", name = "区域新增")
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public CzgResult<Boolean> add(@RequestBody @Validated ShopAreaAddDTO shopAreaAddDTO) {
|
public CzgResult<Boolean> add(@RequestBody @Validated ShopAreaAddDTO shopAreaAddDTO) {
|
||||||
return CzgResult.success(shopTableAreaService.add(shopAreaAddDTO));
|
return CzgResult.success(shopTableAreaService.add(shopAreaAddDTO));
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ dubbo:
|
||||||
threads: 20
|
threads: 20
|
||||||
name: dubbo
|
name: dubbo
|
||||||
serialization: hessian2
|
serialization: hessian2
|
||||||
port: -1
|
port: 10101
|
||||||
|
|
||||||
|
|
||||||
seata:
|
seata:
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ dubbo:
|
||||||
group: server-test
|
group: server-test
|
||||||
protocol:
|
protocol:
|
||||||
threads: 20
|
threads: 20
|
||||||
port: -1
|
port: 10102
|
||||||
name: dubbo
|
name: dubbo
|
||||||
serialization: hessian2
|
serialization: hessian2
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,13 +29,13 @@ spring:
|
||||||
dubbo:
|
dubbo:
|
||||||
application:
|
application:
|
||||||
name: order-server
|
name: order-server
|
||||||
# qos-port: 22231
|
qos-port: 22231
|
||||||
qos-enable: false
|
qos-enable: true
|
||||||
registry:
|
registry:
|
||||||
address: nacos://121.40.109.122:8848 # Nacos 服务地址
|
address: nacos://121.40.109.122:8848 # Nacos 服务地址
|
||||||
group: server-dev
|
group: server-dev
|
||||||
protocol:
|
protocol:
|
||||||
port: -1
|
port: 10201
|
||||||
threads: 20
|
threads: 20
|
||||||
name: dubbo
|
name: dubbo
|
||||||
serialization: hessian2
|
serialization: hessian2
|
||||||
|
|
|
||||||
|
|
@ -30,15 +30,15 @@ spring:
|
||||||
dubbo:
|
dubbo:
|
||||||
application:
|
application:
|
||||||
name: order-server
|
name: order-server
|
||||||
# qos-port: 22232
|
qos-port: 22232
|
||||||
qos-enable: false
|
qos-enable: true
|
||||||
logger: log4j2
|
logger: log4j2
|
||||||
environment: test
|
environment: test
|
||||||
registry:
|
registry:
|
||||||
address: nacos://121.40.109.122:8848 # Nacos 服务地址
|
address: nacos://121.40.109.122:8848 # Nacos 服务地址
|
||||||
group: server-test
|
group: server-test
|
||||||
protocol:
|
protocol:
|
||||||
port: -1
|
port: 10202
|
||||||
threads: 20
|
threads: 20
|
||||||
name: dubbo
|
name: dubbo
|
||||||
serialization: hessian2
|
serialization: hessian2
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ dubbo:
|
||||||
address: nacos://121.40.109.122:8848 # Nacos 服务地址
|
address: nacos://121.40.109.122:8848 # Nacos 服务地址
|
||||||
group: server-dev
|
group: server-dev
|
||||||
protocol:
|
protocol:
|
||||||
port: -1
|
port: 10301
|
||||||
threads: 20
|
threads: 20
|
||||||
name: dubbo
|
name: dubbo
|
||||||
serialization: hessian2
|
serialization: hessian2
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ dubbo:
|
||||||
address: nacos://121.40.109.122:8848 # Nacos 服务地址
|
address: nacos://121.40.109.122:8848 # Nacos 服务地址
|
||||||
group: server-test
|
group: server-test
|
||||||
protocol:
|
protocol:
|
||||||
port: -1
|
port: 10302
|
||||||
threads: 20
|
threads: 20
|
||||||
name: dubbo
|
name: dubbo
|
||||||
serialization: hessian2
|
serialization: hessian2
|
||||||
|
|
|
||||||
|
|
@ -58,6 +58,7 @@ public class MiniAppPagesController {
|
||||||
* @param status 小程序页面状态 -1 查全部 1 启用 0 禁用
|
* @param status 小程序页面状态 -1 查全部 1 启用 0 禁用
|
||||||
*/
|
*/
|
||||||
@GetMapping("page")
|
@GetMapping("page")
|
||||||
|
@SaAdminCheckPermission(value = "miniAppPages:page", name = "小程序页面分页")
|
||||||
public CzgResult<Page<MiniAppPagesDTO>> getMiniAppPage(String name, String path, Integer status) {
|
public CzgResult<Page<MiniAppPagesDTO>> getMiniAppPage(String name, String path, Integer status) {
|
||||||
return miniAppPageService.getMiniAppPage(name, path, status);
|
return miniAppPageService.getMiniAppPage(name, path, status);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ dubbo:
|
||||||
address: nacos://121.40.109.122:8848 # Nacos 服务地址
|
address: nacos://121.40.109.122:8848 # Nacos 服务地址
|
||||||
group: server-dev
|
group: server-dev
|
||||||
protocol:
|
protocol:
|
||||||
port: -1
|
port: 10401
|
||||||
threads: 20
|
threads: 20
|
||||||
name: dubbo
|
name: dubbo
|
||||||
serialization: hessian2
|
serialization: hessian2
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ dubbo:
|
||||||
address: nacos://121.40.109.122:8848 # Nacos 服务地址
|
address: nacos://121.40.109.122:8848 # Nacos 服务地址
|
||||||
group: server-test
|
group: server-test
|
||||||
protocol:
|
protocol:
|
||||||
port: -1
|
port: 10402
|
||||||
threads: 20
|
threads: 20
|
||||||
name: dubbo
|
name: dubbo
|
||||||
serialization: hessian2
|
serialization: hessian2
|
||||||
|
|
|
||||||
|
|
@ -1,45 +0,0 @@
|
||||||
package com.czg.config;
|
|
||||||
|
|
||||||
import com.mybatisflex.core.dialect.impl.CommonsDialectImpl;
|
|
||||||
import com.mybatisflex.core.exception.FlexExceptions;
|
|
||||||
import com.mybatisflex.core.exception.locale.LocalizedFormats;
|
|
||||||
import com.mybatisflex.core.query.CPI;
|
|
||||||
import com.mybatisflex.core.query.QueryCondition;
|
|
||||||
import com.mybatisflex.core.query.QueryTable;
|
|
||||||
import com.mybatisflex.core.query.QueryWrapper;
|
|
||||||
import com.mybatisflex.core.util.StringUtil;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import static com.mybatisflex.core.constant.SqlConsts.ASTERISK;
|
|
||||||
import static com.mybatisflex.core.constant.SqlConsts.WHERE;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 自定义sql解析器 备用
|
|
||||||
*/
|
|
||||||
//@Component
|
|
||||||
public class MyCommonsDialectImpl extends CommonsDialectImpl {
|
|
||||||
@Override
|
|
||||||
public String wrap(String keyword) {
|
|
||||||
return ASTERISK.equals(keyword) ? keyword : keywordWrap.wrap(keyword);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void buildWhereSql(StringBuilder sqlBuilder, QueryWrapper queryWrapper, List<QueryTable> queryTables, boolean allowNoCondition) {
|
|
||||||
QueryCondition whereQueryCondition = CPI.getWhereQueryCondition(queryWrapper);
|
|
||||||
if (whereQueryCondition != null) {
|
|
||||||
String whereSql = whereQueryCondition.toSql(queryTables, this);
|
|
||||||
if (StringUtil.hasText(whereSql)) {
|
|
||||||
sqlBuilder.append(WHERE).append(whereSql);
|
|
||||||
} else if (!allowNoCondition) {
|
|
||||||
throw FlexExceptions.wrap(LocalizedFormats.UPDATE_OR_DELETE_NOT_ALLOW);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// whereQueryCondition == null
|
|
||||||
if (!allowNoCondition) {
|
|
||||||
throw FlexExceptions.wrap(LocalizedFormats.UPDATE_OR_DELETE_NOT_ALLOW);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,36 +0,0 @@
|
||||||
package com.czg.config;
|
|
||||||
|
|
||||||
import com.mybatisflex.core.audit.AuditManager;
|
|
||||||
import com.mybatisflex.core.dialect.DbType;
|
|
||||||
import com.mybatisflex.core.dialect.DialectFactory;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.context.annotation.Configuration;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 自定义sql方言
|
|
||||||
*
|
|
||||||
* @author Administrator
|
|
||||||
*/
|
|
||||||
@Configuration
|
|
||||||
@Slf4j(topic = "mybatis-flex-sql")
|
|
||||||
public class MybatisFlexConfig {
|
|
||||||
|
|
||||||
public MybatisFlexConfig() {
|
|
||||||
//开启审计功能
|
|
||||||
AuditManager.setAuditEnable(true);
|
|
||||||
|
|
||||||
//设置 SQL 审计收集器
|
|
||||||
AuditManager.setMessageCollector(auditMessage ->
|
|
||||||
log.info("{},{}ms", auditMessage.getFullSql()
|
|
||||||
, auditMessage.getElapsedTime())
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
// @Resource
|
|
||||||
private MyCommonsDialectImpl myCommonsDialect;
|
|
||||||
|
|
||||||
// @PostConstruct
|
|
||||||
public void init() {
|
|
||||||
DialectFactory.registerDialect(DbType.MYSQL, myCommonsDialect);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -37,6 +37,10 @@ public class ShopUserDetailDTO extends ShopUser {
|
||||||
* 店铺信息
|
* 店铺信息
|
||||||
*/
|
*/
|
||||||
private ShopInfo shopInfo;
|
private ShopInfo shopInfo;
|
||||||
|
/**
|
||||||
|
* 支付密码
|
||||||
|
*/
|
||||||
|
private String payPwd;
|
||||||
/**
|
/**
|
||||||
* 店铺拓展参数
|
* 店铺拓展参数
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ public interface SysRoleService extends IService<SysRole> {
|
||||||
|
|
||||||
List<SysRole> getByUserId(Long id);
|
List<SysRole> getByUserId(Long id);
|
||||||
|
|
||||||
Page<SysRole> getList(PageDTO pageDTO, String key, String startTime, String endTime);
|
Page<SysRole> getList(Long shopId, PageDTO pageDTO, String key, String startTime, String endTime);
|
||||||
|
|
||||||
Boolean add(RoleAddDTO roleAddDTO);
|
Boolean add(RoleAddDTO roleAddDTO);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ public class AuthorizationServiceImpl implements AuthorizationService {
|
||||||
SpecCaptcha captcha = new SpecCaptcha(130, 48, 4);
|
SpecCaptcha captcha = new SpecCaptcha(130, 48, 4);
|
||||||
|
|
||||||
// 获取验证码文本
|
// 获取验证码文本
|
||||||
String code = captcha.text();
|
String code = captcha.text().toLowerCase();
|
||||||
|
|
||||||
// 生成唯一的验证码 ID
|
// 生成唯一的验证码 ID
|
||||||
String captchaKey = IdUtil.randomUUID();
|
String captchaKey = IdUtil.randomUUID();
|
||||||
|
|
@ -70,10 +70,10 @@ public class AuthorizationServiceImpl implements AuthorizationService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public LoginVO login(SysLoginDTO loginDTO) {
|
public LoginVO login(SysLoginDTO loginDTO) {
|
||||||
// Object code = redisService.get(RedisCst.LOGIN_CODE + loginDTO.uuid());
|
Object code = redisService.get(RedisCst.LOGIN_CODE + loginDTO.uuid());
|
||||||
// if (!"666666".equals(loginDTO.code()) && code == null || !code.equals(loginDTO.code())) {
|
if (!"666666".equals(loginDTO.code()) && (code == null || !code.equals(loginDTO.code().toLowerCase()))) {
|
||||||
// throw new ApiNotPrintException("验证码错误");
|
throw new ApiNotPrintException("验证码错误");
|
||||||
// }
|
}
|
||||||
|
|
||||||
SysUser user;
|
SysUser user;
|
||||||
// 员工账号登录
|
// 员工账号登录
|
||||||
|
|
|
||||||
|
|
@ -117,7 +117,7 @@ public class ShopInfoServiceImpl extends ServiceImpl<ShopInfoMapper, ShopInfo> i
|
||||||
}
|
}
|
||||||
|
|
||||||
// 添加系统账号
|
// 添加系统账号
|
||||||
shopInfoAddDTO.setRoleId(shopInfoAddDTO.getRoleId() == null ? 1L : shopInfoAddDTO.getRoleId());
|
shopInfoAddDTO.setRoleId(shopInfoAddDTO.getRoleId() == null ? 2L : shopInfoAddDTO.getRoleId());
|
||||||
SysUser sysUser = sysUserService.addUser(shopInfoAddDTO.getShopName(), shopInfoAddDTO.getAccountName(), shopInfoAddDTO.getAccountPwd(), shopInfoAddDTO.getPhone(), shopInfoAddDTO.getRoleId());
|
SysUser sysUser = sysUserService.addUser(shopInfoAddDTO.getShopName(), shopInfoAddDTO.getAccountName(), shopInfoAddDTO.getAccountPwd(), shopInfoAddDTO.getPhone(), shopInfoAddDTO.getRoleId());
|
||||||
|
|
||||||
// 保存店铺信息
|
// 保存店铺信息
|
||||||
|
|
|
||||||
|
|
@ -252,28 +252,34 @@ public class ShopUserServiceImpl extends ServiceImpl<ShopUserMapper, ShopUser> i
|
||||||
userInfoService.updateById(userInfo);
|
userInfoService.updateById(userInfo);
|
||||||
|
|
||||||
ShopUser shopUser = getOne(new QueryWrapper().eq(ShopUser::getShopId, shopId).eq(ShopUser::getUserId, userId));
|
ShopUser shopUser = getOne(new QueryWrapper().eq(ShopUser::getShopId, shopId).eq(ShopUser::getUserId, userId));
|
||||||
if (shopUser != null) {
|
if (shopUser == null) {
|
||||||
|
shopUser = new ShopUser();
|
||||||
|
shopUser.setShopId(shopId);
|
||||||
|
shopUser.setUserId(userId);
|
||||||
|
save(shopUser);
|
||||||
|
} else if (shopUser.getIsVip() == 1) {
|
||||||
throw new ApiNotPrintException("您已加入店铺会员");
|
throw new ApiNotPrintException("您已加入店铺会员");
|
||||||
}
|
}
|
||||||
|
BeanUtil.copyProperties(shopUserAddDTO, shopUser);
|
||||||
shopUser = BeanUtil.copyProperties(shopUserAddDTO, ShopUser.class);
|
|
||||||
shopUser.setIsVip(1);
|
shopUser.setIsVip(1);
|
||||||
shopUser.setCode(generateCode(shopId));
|
shopUser.setCode(generateCode(shopId));
|
||||||
shopUser.setJoinTime(DateUtil.date().toLocalDateTime());
|
shopUser.setJoinTime(DateUtil.date().toLocalDateTime());
|
||||||
shopUser.setShopId(shopId);
|
shopUser.setUserId(null);
|
||||||
shopUser.setUserId(userId);
|
shopUser.setShopId(null);
|
||||||
return save(shopUser);
|
|
||||||
|
return updateById(shopUser);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ShopUserDetailDTO getInfo(Long shopId, long userId) {
|
public ShopUserDetailDTO getInfo(Long shopId, long userId) {
|
||||||
ShopUser shopUser = getOne(new QueryWrapper().eq(ShopUser::getShopId, shopId).eq(ShopUser::getUserId, userId));
|
ShopUser shopUser = getOne(new QueryWrapper().eq(ShopUser::getShopId, shopId).eq(ShopUser::getUserId, userId));
|
||||||
|
UserInfo userInfo = userInfoService.getById(userId);
|
||||||
|
if (userInfo == null) {
|
||||||
|
throw new ApiNotPrintException("用户信息不存在");
|
||||||
|
}
|
||||||
|
|
||||||
long couponNum = 0;
|
long couponNum = 0;
|
||||||
if (shopUser == null) {
|
if (shopUser == null) {
|
||||||
UserInfo userInfo = userInfoService.getById(userId);
|
|
||||||
if (userInfo == null) {
|
|
||||||
throw new ApiNotPrintException("用户信息不存在");
|
|
||||||
}
|
|
||||||
shopUser = BeanUtil.copyProperties(userInfo, ShopUser.class);
|
shopUser = BeanUtil.copyProperties(userInfo, ShopUser.class);
|
||||||
shopUser.setShopId(shopId);
|
shopUser.setShopId(shopId);
|
||||||
shopUser.setId(null);
|
shopUser.setId(null);
|
||||||
|
|
@ -294,6 +300,8 @@ public class ShopUserServiceImpl extends ServiceImpl<ShopUserMapper, ShopUser> i
|
||||||
List<ShopExtend> shopExtends = shopExtendService.list(new QueryWrapper().eq(ShopExtend::getShopId, shopInfo.getId()));
|
List<ShopExtend> shopExtends = shopExtendService.list(new QueryWrapper().eq(ShopExtend::getShopId, shopInfo.getId()));
|
||||||
shopUserDetailDTO.setShopExtendList(shopExtends);
|
shopUserDetailDTO.setShopExtendList(shopExtends);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
shopUserDetailDTO.setPayPwd(userInfo.getPayPwd());
|
||||||
return shopUserDetailDTO;
|
return shopUserDetailDTO;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> imp
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Page<SysRole> getList(PageDTO pageDTO, String key, String startTime, String endTime) {
|
public Page<SysRole> getList(Long shopId, PageDTO pageDTO, String key, String startTime, String endTime) {
|
||||||
QueryWrapper queryWrapper = new QueryWrapper();
|
QueryWrapper queryWrapper = new QueryWrapper();
|
||||||
if (!StpKit.USER.isAdmin()) {
|
if (!StpKit.USER.isAdmin()) {
|
||||||
queryWrapper.eq(SysRole::getCreateUserId, StpKit.USER.getLoginIdAsLong());
|
queryWrapper.eq(SysRole::getCreateUserId, StpKit.USER.getLoginIdAsLong());
|
||||||
|
|
|
||||||
|
|
@ -608,6 +608,9 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
|
||||||
if (payOrderId != null) {
|
if (payOrderId != null) {
|
||||||
updateChain.set(OrderInfo::getPayOrderId, payOrderId);
|
updateChain.set(OrderInfo::getPayOrderId, payOrderId);
|
||||||
}
|
}
|
||||||
|
if (orderInfo.getCreditBuyerId() != null) {
|
||||||
|
updateChain.set(OrderInfo::getCreditBuyerId, orderInfo.getCreditBuyerId());
|
||||||
|
}
|
||||||
if (ObjectUtil.isNotNull(payType)) {
|
if (ObjectUtil.isNotNull(payType)) {
|
||||||
updateChain.set(OrderInfo::getPayType, payType.getValue());
|
updateChain.set(OrderInfo::getPayType, payType.getValue());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -140,7 +140,7 @@ public class PayServiceImpl implements PayService {
|
||||||
@Override
|
@Override
|
||||||
@Transactional(noRollbackFor = PaySuccessException.class)
|
@Transactional(noRollbackFor = PaySuccessException.class)
|
||||||
public CzgResult<Object> creditPayOrder(OrderPayParamDTO payParam) {
|
public CzgResult<Object> creditPayOrder(OrderPayParamDTO payParam) {
|
||||||
AssertUtil.isNull(payParam.getCreditBuyerId(), "挂账人不可为空");
|
AssertUtil.isNull(payParam.getCreditBuyerId(), "请选择挂账人后支付");
|
||||||
OrderInfo orderInfo = checkPay(payParam.getCheckOrderPay());
|
OrderInfo orderInfo = checkPay(payParam.getCheckOrderPay());
|
||||||
orderInfo.setCreditBuyerId(payParam.getCreditBuyerId());
|
orderInfo.setCreditBuyerId(payParam.getCreditBuyerId());
|
||||||
orderInfoService.upOrderInfo(orderInfo, orderInfo.getOrderAmount(),
|
orderInfoService.upOrderInfo(orderInfo, orderInfo.getOrderAmount(),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue