bug--修复菜单权限问题以及定时任务

This commit is contained in:
taozi
2020-07-10 17:22:34 +08:00
parent 3c8b165786
commit 75304db04c
23 changed files with 301 additions and 63 deletions

View File

@ -49,7 +49,7 @@ public class StoreBargainController {
@Log("查询砍价")
@ApiOperation(value = "查询砍价")
@GetMapping(value = "/yxStoreBargain")
@PreAuthorize("@el.check('admin','YXSTOREBARGAIN_ALL','YXSTOREBARGAIN_SELECT')")
@PreAuthorize("hasAnyRole('admin','YXSTOREBARGAIN_ALL','YXSTOREBARGAIN_SELECT')")
public ResponseEntity getYxStoreBargains(YxStoreBargainQueryCriteria criteria, Pageable pageable){
return new ResponseEntity<>(yxStoreBargainService.queryAll(criteria,pageable),HttpStatus.OK);
}
@ -59,7 +59,7 @@ public class StoreBargainController {
@Log("修改砍价")
@ApiOperation(value = "修改砍价")
@PutMapping(value = "/yxStoreBargain")
@PreAuthorize("@el.check('admin','YXSTOREBARGAIN_ALL','YXSTOREBARGAIN_EDIT')")
@PreAuthorize("hasAnyRole('admin','YXSTOREBARGAIN_ALL','YXSTOREBARGAIN_EDIT')")
public ResponseEntity update(@Validated @RequestBody YxStoreBargain resources){
if(resources.getBargainMinPrice().compareTo(resources.getBargainMaxPrice()) >= 0){
throw new YshopException("单次砍最低价不能高于单次砍最高价");
@ -79,7 +79,7 @@ public class StoreBargainController {
@Log("删除砍价")
@ApiOperation(value = "删除砍价")
@DeleteMapping(value = "/yxStoreBargain/{id}")
@PreAuthorize("@el.check('admin','YXSTOREBARGAIN_ALL','YXSTOREBARGAIN_DELETE')")
@PreAuthorize("hasAnyRole('admin','YXSTOREBARGAIN_ALL','YXSTOREBARGAIN_DELETE')")
public ResponseEntity delete(@PathVariable Integer id){
yxStoreBargainService.removeById(id);
return new ResponseEntity(HttpStatus.OK);

View File

@ -48,7 +48,7 @@ public class StoreCombinationController {
@Log("查询拼团")
@ApiOperation(value = "查询拼团")
@GetMapping(value = "/yxStoreCombination")
@PreAuthorize("@el.check('admin','YXSTORECOMBINATION_ALL','YXSTORECOMBINATION_SELECT')")
@PreAuthorize("hasAnyRole('admin','YXSTORECOMBINATION_ALL','YXSTORECOMBINATION_SELECT')")
public ResponseEntity getYxStoreCombinations(YxStoreCombinationQueryCriteria criteria, Pageable pageable){
return new ResponseEntity<>(yxStoreCombinationService.queryAll(criteria,pageable),HttpStatus.OK);
}
@ -58,7 +58,7 @@ public class StoreCombinationController {
@Log("修改拼团")
@ApiOperation(value = "新增/修改拼团")
@PutMapping(value = "/yxStoreCombination")
@PreAuthorize("@el.check('admin','YXSTORECOMBINATION_ALL','YXSTORECOMBINATION_EDIT')")
@PreAuthorize("hasAnyRole('admin','YXSTORECOMBINATION_ALL','YXSTORECOMBINATION_EDIT')")
public ResponseEntity update(@Validated @RequestBody YxStoreCombination resources){
if(ObjectUtil.isNull(resources.getId())){
return new ResponseEntity<>(yxStoreCombinationService.save(resources),HttpStatus.CREATED);
@ -83,7 +83,7 @@ public class StoreCombinationController {
@Log("删除拼团")
@ApiOperation(value = "删除拼团")
@DeleteMapping(value = "/yxStoreCombination/{id}")
@PreAuthorize("@el.check('admin','YXSTORECOMBINATION_ALL','YXSTORECOMBINATION_DELETE')")
@PreAuthorize("hasAnyRole('admin','YXSTORECOMBINATION_ALL','YXSTORECOMBINATION_DELETE')")
public ResponseEntity delete(@PathVariable Long id){
yxStoreCombinationService.removeById(id);
return new ResponseEntity(HttpStatus.OK);

View File

@ -47,7 +47,7 @@ public class StoreCouponIssueUserController {
@Log("查询")
@ApiOperation(value = "查询")
@GetMapping(value = "/yxStoreCouponIssueUser")
@PreAuthorize("@el.check('admin','YXSTORECOUPONISSUEUSER_ALL','YXSTORECOUPONISSUEUSER_SELECT')")
@PreAuthorize("hasAnyRole('admin','YXSTORECOUPONISSUEUSER_ALL','YXSTORECOUPONISSUEUSER_SELECT')")
public ResponseEntity getYxStoreCouponIssueUsers(YxStoreCouponIssueUserQueryCriteria criteria, Pageable pageable){
return new ResponseEntity<>(yxStoreCouponIssueUserService.queryAll(criteria,pageable),HttpStatus.OK);
}
@ -57,7 +57,7 @@ public class StoreCouponIssueUserController {
@Log("删除")
@ApiOperation(value = "删除")
@DeleteMapping(value = "/yxStoreCouponIssueUser/{id}")
@PreAuthorize("@el.check('admin','YXSTORECOUPONISSUEUSER_ALL','YXSTORECOUPONISSUEUSER_DELETE')")
@PreAuthorize("hasAnyRole('admin','YXSTORECOUPONISSUEUSER_ALL','YXSTORECOUPONISSUEUSER_DELETE')")
public ResponseEntity delete(@PathVariable Integer id){
yxStoreCouponIssueUserService.removeById(id);
return new ResponseEntity(HttpStatus.OK);

View File

@ -39,7 +39,7 @@ public class StoreCouponUserController {
@Log("查询Y")
@ApiOperation(value = "查询")
@GetMapping(value = "/yxStoreCouponUser")
@PreAuthorize("@el.check('admin','YXSTORECOUPONUSER_ALL','YXSTORECOUPONUSER_SELECT')")
@PreAuthorize("hasAnyRole('admin','YXSTORECOUPONUSER_ALL','YXSTORECOUPONUSER_SELECT')")
public ResponseEntity getYxStoreCouponUsers(YxStoreCouponUserQueryCriteria criteria, Pageable pageable){
return new ResponseEntity(yxStoreCouponUserService.queryAll(criteria,pageable),HttpStatus.OK);
}

View File

@ -45,7 +45,7 @@ public class StoreSeckillController {
@Log("列表")
@ApiOperation(value = "列表")
@GetMapping(value = "/yxStoreSeckill")
@PreAuthorize("@el.check('admin','YXSTORESECKILL_ALL','YXSTORESECKILL_SELECT')")
@PreAuthorize("hasAnyRole('admin','YXSTORESECKILL_ALL','YXSTORESECKILL_SELECT')")
public ResponseEntity getYxStoreSeckills(YxStoreSeckillQueryCriteria criteria, Pageable pageable){
return new ResponseEntity<>(yxStoreSeckillService.queryAll(criteria,pageable),HttpStatus.OK);
}
@ -55,7 +55,7 @@ public class StoreSeckillController {
@Log("发布")
@ApiOperation(value = "发布")
@PutMapping(value = "/yxStoreSeckill")
@PreAuthorize("@el.check('admin','YXSTORESECKILL_ALL','YXSTORESECKILL_EDIT')")
@PreAuthorize("hasAnyRole('admin','YXSTORESECKILL_ALL','YXSTORESECKILL_EDIT')")
public ResponseEntity update(@Validated @RequestBody YxStoreSeckill resources){
if(ObjectUtil.isNull(resources.getId())){
return new ResponseEntity<>(yxStoreSeckillService.save(resources),HttpStatus.CREATED);
@ -69,7 +69,7 @@ public class StoreSeckillController {
@Log("删除")
@ApiOperation(value = "删除")
@DeleteMapping(value = "/yxStoreSeckill/{id}")
@PreAuthorize("@el.check('admin','YXSTORESECKILL_ALL','YXSTORESECKILL_DELETE')")
@PreAuthorize("hasAnyRole('admin','YXSTORESECKILL_ALL','YXSTORESECKILL_DELETE')")
public ResponseEntity delete(@PathVariable Integer id){
yxStoreSeckillService.removeById(id);
return new ResponseEntity(HttpStatus.OK);

View File

@ -41,7 +41,7 @@ public class UserExtractController {
@Log("查询")
@ApiOperation(value = "查询")
@GetMapping(value = "/yxUserExtract")
@PreAuthorize("@el.check('admin','YXUSEREXTRACT_ALL','YXUSEREXTRACT_SELECT')")
@PreAuthorize("hasAnyRole('admin','YXUSEREXTRACT_ALL','YXUSEREXTRACT_SELECT')")
public ResponseEntity getYxUserExtracts(YxUserExtractQueryCriteria criteria, Pageable pageable){
return new ResponseEntity<>(yxUserExtractService.queryAll(criteria,pageable),HttpStatus.OK);
}
@ -51,7 +51,7 @@ public class UserExtractController {
@Log("修改审核")
@ApiOperation(value = "修改审核")
@PutMapping(value = "/yxUserExtract")
@PreAuthorize("@el.check('admin','YXUSEREXTRACT_ALL','YXUSEREXTRACT_EDIT')")
@PreAuthorize("hasAnyRole('admin','YXUSEREXTRACT_ALL','YXUSEREXTRACT_EDIT')")
public ResponseEntity update(@Validated @RequestBody YxUserExtract resources){
yxUserExtractService.doExtract(resources);
return new ResponseEntity(HttpStatus.NO_CONTENT);

View File

@ -66,7 +66,7 @@ public class StoreCategoryController {
@Log("查询商品分类")
@ApiOperation(value = "查询商品分类")
@GetMapping(value = "/yxStoreCategory")
@PreAuthorize("@el.check('admin','YXSTORECATEGORY_ALL','YXSTORECATEGORY_SELECT')")
@PreAuthorize("hasAnyRole('admin','YXSTORECATEGORY_ALL','YXSTORECATEGORY_SELECT')")
public ResponseEntity getYxStoreCategorys(YxStoreCategoryQueryCriteria criteria, Pageable pageable){
List<YxStoreCategoryDto> categoryDTOList = yxStoreCategoryService.queryAll(criteria);
return new ResponseEntity<>(yxStoreCategoryService.buildTree(categoryDTOList),HttpStatus.OK);
@ -77,7 +77,7 @@ public class StoreCategoryController {
@ApiOperation(value = "新增商品分类")
@PostMapping(value = "/yxStoreCategory")
@CacheEvict(cacheNames = ShopConstants.YSHOP_REDIS_INDEX_KEY,allEntries = true)
@PreAuthorize("@el.check('admin','YXSTORECATEGORY_ALL','YXSTORECATEGORY_CREATE')")
@PreAuthorize("hasAnyRole('admin','YXSTORECATEGORY_ALL','YXSTORECATEGORY_CREATE')")
public ResponseEntity create(@Validated @RequestBody YxStoreCategory resources){
if(resources.getPid() != null && resources.getPid() > 0 && StrUtil.isBlank(resources.getPic())) {
throw new YshopException("子分类图片必传");
@ -94,7 +94,7 @@ public class StoreCategoryController {
@ApiOperation(value = "修改商品分类")
@CacheEvict(cacheNames = ShopConstants.YSHOP_REDIS_INDEX_KEY,allEntries = true)
@PutMapping(value = "/yxStoreCategory")
@PreAuthorize("@el.check('admin','YXSTORECATEGORY_ALL','YXSTORECATEGORY_EDIT')")
@PreAuthorize("hasAnyRole('admin','YXSTORECATEGORY_ALL','YXSTORECATEGORY_EDIT')")
public ResponseEntity update(@Validated @RequestBody YxStoreCategory resources){
if(resources.getPid() != null && resources.getPid() > 0 && StrUtil.isBlank(resources.getPic())) {
throw new YshopException("子分类图片必传");
@ -107,7 +107,7 @@ public class StoreCategoryController {
boolean checkResult = yxStoreCategoryService.checkCategory(resources.getPid());
if(!checkResult) throw new YshopException("分类最多能添加2级哦");
yxStoreCategoryService.saveOrUpdate(resources);
return new ResponseEntity(HttpStatus.NO_CONTENT);
}
@ -117,7 +117,7 @@ public class StoreCategoryController {
@ApiOperation(value = "删除商品分类")
@CacheEvict(cacheNames = ShopConstants.YSHOP_REDIS_INDEX_KEY,allEntries = true)
@DeleteMapping(value = "/yxStoreCategory/{id}")
@PreAuthorize("@el.check('admin','YXSTORECATEGORY_ALL','YXSTORECATEGORY_DELETE')")
@PreAuthorize("hasAnyRole('admin','YXSTORECATEGORY_ALL','YXSTORECATEGORY_DELETE')")
public ResponseEntity delete(@PathVariable String id){
String[] ids = id.split(",");
for (String newId: ids) {

View File

@ -107,7 +107,7 @@ public class StoreOrderController {
@ApiOperation(value = "查询订单")
@GetMapping(value = "/yxStoreOrder")
@PreAuthorize("@el.check('admin','YXSTOREORDER_ALL','YXSTOREORDER_SELECT')")
@PreAuthorize("hasAnyRole('admin','YXSTOREORDER_ALL','YXSTOREORDER_SELECT')")
public ResponseEntity getYxStoreOrders(YxStoreOrderQueryCriteria criteria,
Pageable pageable,
@RequestParam(name = "orderStatus") String orderStatus,
@ -121,7 +121,7 @@ public class StoreOrderController {
@ApiOperation(value = "发货")
@PutMapping(value = "/yxStoreOrder")
@PreAuthorize("@el.check('admin','YXSTOREORDER_ALL','YXSTOREORDER_EDIT')")
@PreAuthorize("hasAnyRole('admin','YXSTOREORDER_ALL','YXSTOREORDER_EDIT')")
public ResponseEntity update(@Validated @RequestBody YxStoreOrder resources) {
if (StrUtil.isBlank(resources.getDeliveryName())) throw new BadRequestException("请选择快递公司");
if (StrUtil.isBlank(resources.getDeliveryId())) throw new BadRequestException("快递单号不能为空");
@ -133,7 +133,7 @@ public class StoreOrderController {
@ApiOperation(value = "订单核销")
@PutMapping(value = "/yxStoreOrder/check")
@PreAuthorize("@el.check('admin','YXSTOREORDER_ALL','YXSTOREORDER_EDIT')")
@PreAuthorize("hasAnyRole('admin','YXSTOREORDER_ALL','YXSTOREORDER_EDIT')")
public ResponseEntity check(@Validated @RequestBody YxStoreOrder resources) {
if (StrUtil.isBlank(resources.getVerifyCode())) throw new BadRequestException("核销码不能为空");
YxStoreOrderDto storeOrderDTO = generator.convert(yxStoreOrderService.getById(resources.getId()),YxStoreOrderDto.class);
@ -153,7 +153,7 @@ public class StoreOrderController {
@ApiOperation(value = "退款")
@PostMapping(value = "/yxStoreOrder/refund")
@PreAuthorize("@el.check('admin','YXSTOREORDER_ALL','YXSTOREORDER_EDIT')")
@PreAuthorize("hasAnyRole('admin','YXSTOREORDER_ALL','YXSTOREORDER_EDIT')")
public ResponseEntity refund(@Validated @RequestBody YxStoreOrder resources) {
yxStoreOrderService.orderRefund(resources.getOrderId(),resources.getPayPrice(),
ShopCommonEnum.AGREE_1.getValue());
@ -165,7 +165,7 @@ public class StoreOrderController {
@Log("删除")
@ApiOperation(value = "删除")
@DeleteMapping(value = "/yxStoreOrder/{id}")
@PreAuthorize("@el.check('admin','YXSTOREORDER_ALL','YXSTOREORDER_DELETE')")
@PreAuthorize("hasAnyRole('admin','YXSTOREORDER_ALL','YXSTOREORDER_DELETE')")
public ResponseEntity delete(@PathVariable Integer id) {
yxStoreOrderService.removeById(id);
return new ResponseEntity(HttpStatus.OK);

View File

@ -77,7 +77,7 @@ public class StoreProductController {
@Log("查询商品")
@ApiOperation(value = "查询商品")
@GetMapping(value = "/yxStoreProduct")
@PreAuthorize("@el.check('admin','YXSTOREPRODUCT_ALL','YXSTOREPRODUCT_SELECT')")
@PreAuthorize("hasAnyRole('admin','YXSTOREPRODUCT_ALL','YXSTOREPRODUCT_SELECT')")
public ResponseEntity getYxStoreProducts(YxStoreProductQueryCriteria criteria, Pageable pageable){
return new ResponseEntity<>(yxStoreProductService.queryAll(criteria,pageable),HttpStatus.OK);
}
@ -87,7 +87,7 @@ public class StoreProductController {
@ApiOperation(value = "新增/修改商品")
@CacheEvict(cacheNames = ShopConstants.YSHOP_REDIS_INDEX_KEY,allEntries = true)
@PostMapping(value = "/yxStoreProduct/addOrSave")
@PreAuthorize("@el.check('admin','YXSTOREPRODUCT_ALL','YXSTOREPRODUCT_CREATE')")
@PreAuthorize("hasAnyRole('admin','YXSTOREPRODUCT_ALL','YXSTOREPRODUCT_CREATE')")
public ResponseEntity create(@Validated @RequestBody StoreProductDto storeProductDto){
yxStoreProductService.insertAndEditYxStoreProduct(storeProductDto);
return new ResponseEntity<>(HttpStatus.CREATED);
@ -99,7 +99,7 @@ public class StoreProductController {
@ApiOperation(value = "删除商品")
@CacheEvict(cacheNames = ShopConstants.YSHOP_REDIS_INDEX_KEY,allEntries = true)
@DeleteMapping(value = "/yxStoreProduct/{id}")
@PreAuthorize("@el.check('admin','YXSTOREPRODUCT_ALL','YXSTOREPRODUCT_DELETE')")
@PreAuthorize("hasAnyRole('admin','YXSTOREPRODUCT_ALL','YXSTOREPRODUCT_DELETE')")
public ResponseEntity delete(@PathVariable Long id){
yxStoreProductService.removeById(id);
return new ResponseEntity(HttpStatus.OK);

View File

@ -50,7 +50,7 @@ public class StoreProductReplyController {
@Log("查询")
@ApiOperation(value = "查询")
@GetMapping(value = "/yxStoreProductReply")
@PreAuthorize("@el.check('admin','YXSTOREPRODUCTREPLY_ALL','YXSTOREPRODUCTREPLY_SELECT')")
@PreAuthorize("hasAnyRole('admin','YXSTOREPRODUCTREPLY_ALL','YXSTOREPRODUCTREPLY_SELECT')")
public ResponseEntity getYxStoreProductReplys(YxStoreProductReplyQueryCriteria criteria, Pageable pageable){
return new ResponseEntity<>(yxStoreProductReplyService.queryAll(criteria,pageable),HttpStatus.OK);
}
@ -60,7 +60,7 @@ public class StoreProductReplyController {
@Log("修改")
@ApiOperation(value = "修改")
@PutMapping(value = "/yxStoreProductReply")
@PreAuthorize("@el.check('admin','YXSTOREPRODUCTREPLY_ALL','YXSTOREPRODUCTREPLY_EDIT')")
@PreAuthorize("hasAnyRole('admin','YXSTOREPRODUCTREPLY_ALL','YXSTOREPRODUCTREPLY_EDIT')")
public ResponseEntity update(@Validated @RequestBody YxStoreProductReply resources){
resources.setMerchantReplyTime(new Date());
resources.setIsReply(ShopCommonEnum.REPLY_1.getValue());
@ -72,7 +72,7 @@ public class StoreProductReplyController {
@Log("删除")
@ApiOperation(value = "删除")
@DeleteMapping(value = "/yxStoreProductReply/{id}")
@PreAuthorize("@el.check('admin','YXSTOREPRODUCTREPLY_ALL','YXSTOREPRODUCTREPLY_DELETE')")
@PreAuthorize("hasAnyRole('admin','YXSTOREPRODUCTREPLY_ALL','YXSTOREPRODUCTREPLY_DELETE')")
public ResponseEntity delete(@PathVariable Long id){
yxStoreProductReplyService.removeById(id);
return new ResponseEntity(HttpStatus.OK);

View File

@ -49,7 +49,7 @@ public class ExpressController {
@Log("查询快递")
@ApiOperation(value = "查询快递")
@GetMapping(value = "/yxExpress")
@PreAuthorize("@el.check('admin','YXEXPRESS_ALL','YXEXPRESS_SELECT')")
@PreAuthorize("hasAnyRole('admin','YXEXPRESS_ALL','YXEXPRESS_SELECT')")
public ResponseEntity getYxExpresss(YxExpressQueryCriteria criteria, Pageable pageable){
return new ResponseEntity<>(yxExpressService.queryAll(criteria,pageable),HttpStatus.OK);
}
@ -58,7 +58,7 @@ public class ExpressController {
@Log("新增快递")
@ApiOperation(value = "新增快递")
@PostMapping(value = "/yxExpress")
@PreAuthorize("@el.check('admin','YXEXPRESS_ALL','YXEXPRESS_CREATE')")
@PreAuthorize("hasAnyRole('admin','YXEXPRESS_ALL','YXEXPRESS_CREATE')")
public ResponseEntity create(@Validated @RequestBody YxExpress resources){
return new ResponseEntity<>(yxExpressService.save(resources),HttpStatus.CREATED);
}
@ -67,7 +67,7 @@ public class ExpressController {
@Log("修改快递")
@ApiOperation(value = "修改快递")
@PutMapping(value = "/yxExpress")
@PreAuthorize("@el.check('admin','YXEXPRESS_ALL','YXEXPRESS_EDIT')")
@PreAuthorize("hasAnyRole('admin','YXEXPRESS_ALL','YXEXPRESS_EDIT')")
public ResponseEntity update(@Validated @RequestBody YxExpress resources){
yxExpressService.saveOrUpdate(resources);
return new ResponseEntity(HttpStatus.NO_CONTENT);
@ -77,7 +77,7 @@ public class ExpressController {
@Log("删除快递")
@ApiOperation(value = "删除快递")
@DeleteMapping(value = "/yxExpress/{id}")
@PreAuthorize("@el.check('admin','YXEXPRESS_ALL','YXEXPRESS_DELETE')")
@PreAuthorize("hasAnyRole('admin','YXEXPRESS_ALL','YXEXPRESS_DELETE')")
public ResponseEntity delete(@PathVariable Integer id){
yxExpressService.removeById(id);
return new ResponseEntity(HttpStatus.OK);

View File

@ -53,7 +53,7 @@ public class SystemConfigController {
@Log("查询")
@ApiOperation(value = "查询")
@GetMapping(value = "/yxSystemConfig")
@PreAuthorize("@el.check('admin','YXSYSTEMCONFIG_ALL','YXSYSTEMCONFIG_SELECT')")
@PreAuthorize("hasAnyRole('admin','YXSYSTEMCONFIG_ALL','YXSYSTEMCONFIG_SELECT')")
public ResponseEntity getYxSystemConfigs(YxSystemConfigQueryCriteria criteria, Pageable pageable){
return new ResponseEntity<>(yxSystemConfigService.queryAll(criteria,pageable),HttpStatus.OK);
}
@ -63,7 +63,7 @@ public class SystemConfigController {
@ApiOperation(value = "新增或修改")
@PostMapping(value = "/yxSystemConfig")
@CacheEvict(cacheNames = ShopConstants.YSHOP_REDIS_INDEX_KEY,allEntries = true)
@PreAuthorize("@el.check('admin','YXSYSTEMCONFIG_ALL','YXSYSTEMCONFIG_CREATE')")
@PreAuthorize("hasAnyRole('admin','YXSYSTEMCONFIG_ALL','YXSYSTEMCONFIG_CREATE')")
public ResponseEntity create(@RequestBody String jsonStr){
JSONObject jsonObject = JSON.parseObject(jsonStr);
jsonObject.forEach(

View File

@ -53,7 +53,7 @@ public class SystemGroupDataController {
@Log("查询数据配置")
@ApiOperation(value = "查询数据配置")
@GetMapping(value = "/yxSystemGroupData")
@PreAuthorize("@el.check('admin','YXSYSTEMGROUPDATA_ALL','YXSYSTEMGROUPDATA_SELECT')")
@PreAuthorize("hasAnyRole('admin','YXSYSTEMGROUPDATA_ALL','YXSYSTEMGROUPDATA_SELECT')")
public ResponseEntity getYxSystemGroupDatas(YxSystemGroupDataQueryCriteria criteria,
Pageable pageable){
Sort sort = new Sort(Sort.Direction.DESC, "sort");
@ -68,7 +68,7 @@ public class SystemGroupDataController {
@ApiOperation(value = "新增数据配置")
@PostMapping(value = "/yxSystemGroupData")
@CacheEvict(cacheNames = ShopConstants.YSHOP_REDIS_INDEX_KEY,allEntries = true)
@PreAuthorize("@el.check('admin','YXSYSTEMGROUPDATA_ALL','YXSYSTEMGROUPDATA_CREATE')")
@PreAuthorize("hasAnyRole('admin','YXSYSTEMGROUPDATA_ALL','YXSYSTEMGROUPDATA_CREATE')")
public ResponseEntity create(@RequestBody String jsonStr){
JSONObject jsonObject = JSON.parseObject(jsonStr);
this.checkParam(jsonObject);
@ -89,7 +89,7 @@ public class SystemGroupDataController {
@ApiOperation(value = "修改数据配置")
@PutMapping(value = "/yxSystemGroupData")
@CacheEvict(cacheNames = ShopConstants.YSHOP_REDIS_INDEX_KEY,allEntries = true)
@PreAuthorize("@el.check('admin','YXSYSTEMGROUPDATA_ALL','YXSYSTEMGROUPDATA_EDIT')")
@PreAuthorize("hasAnyRole('admin','YXSYSTEMGROUPDATA_ALL','YXSYSTEMGROUPDATA_EDIT')")
public ResponseEntity update(@RequestBody String jsonStr){
JSONObject jsonObject = JSON.parseObject(jsonStr);
this.checkParam(jsonObject);
@ -121,7 +121,7 @@ public class SystemGroupDataController {
@Log("删除数据配置")
@ApiOperation(value = "删除数据配置")
@DeleteMapping(value = "/yxSystemGroupData/{id}")
@PreAuthorize("@el.check('admin','YXSYSTEMGROUPDATA_ALL','YXSYSTEMGROUPDATA_DELETE')")
@PreAuthorize("hasAnyRole('admin','YXSYSTEMGROUPDATA_ALL','YXSYSTEMGROUPDATA_DELETE')")
public ResponseEntity delete(@PathVariable Integer id){
yxSystemGroupDataService.removeById(id);
return new ResponseEntity(HttpStatus.OK);

View File

@ -43,7 +43,7 @@ public class MemberController {
@Log("查看下级")
@ApiOperation(value = "查看下级")
@PostMapping(value = "/yxUser/spread")
@PreAuthorize("@el.check('admin','YXUSER_ALL','YXUSER_EDIT')")
@PreAuthorize("hasAnyRole('admin','YXUSER_ALL','YXUSER_EDIT')")
public ResponseEntity getSpread(@RequestBody YxUserQueryCriteria criteria){
return new ResponseEntity<>(yxUserService.querySpread(criteria.getUid(),criteria.getGrade()),
HttpStatus.OK);
@ -52,7 +52,7 @@ public class MemberController {
@Log("查询用户")
@ApiOperation(value = "查询用户")
@GetMapping(value = "/yxUser")
@PreAuthorize("@el.check('admin','YXUSER_ALL','YXUSER_SELECT')")
@PreAuthorize("hasAnyRole('admin','YXUSER_ALL','YXUSER_SELECT')")
public ResponseEntity getYxUsers(YxUserQueryCriteria criteria, Pageable pageable){
return new ResponseEntity<>(yxUserService.queryAll(criteria,pageable),HttpStatus.OK);
}
@ -61,7 +61,7 @@ public class MemberController {
@Log("修改用户")
@ApiOperation(value = "修改用户")
@PutMapping(value = "/yxUser")
@PreAuthorize("@el.check('admin','YXUSER_ALL','YXUSER_EDIT')")
@PreAuthorize("hasAnyRole('admin','YXUSER_ALL','YXUSER_EDIT')")
public ResponseEntity update(@Validated @RequestBody YxUser resources){
yxUserService.saveOrUpdate(resources);
return new ResponseEntity(HttpStatus.NO_CONTENT);
@ -71,7 +71,7 @@ public class MemberController {
@Log("删除用户")
@ApiOperation(value = "删除用户")
@DeleteMapping(value = "/yxUser/{uid}")
@PreAuthorize("@el.check('admin','YXUSER_ALL','YXUSER_DELETE')")
@PreAuthorize("hasAnyRole('admin','YXUSER_ALL','YXUSER_DELETE')")
public ResponseEntity delete(@PathVariable Integer uid){
yxUserService.removeById(uid);
return new ResponseEntity(HttpStatus.OK);
@ -89,7 +89,7 @@ public class MemberController {
@ApiOperation(value = "修改余额")
@PostMapping(value = "/yxUser/money")
@PreAuthorize("@el.check('admin','YXUSER_ALL','YXUSER_EDIT')")
@PreAuthorize("hasAnyRole('admin','YXUSER_ALL','YXUSER_EDIT')")
public ResponseEntity updatePrice(@Validated @RequestBody UserMoneyDto param){
yxUserService.updateMoney(param);
return new ResponseEntity(HttpStatus.NO_CONTENT);

View File

@ -45,7 +45,7 @@ public class SystemUserLevelController {
@Log("查询")
@ApiOperation(value = "查询")
@GetMapping(value = "/yxSystemUserLevel")
@PreAuthorize("@el.check('admin','YXSYSTEMUSERLEVEL_ALL','YXSYSTEMUSERLEVEL_SELECT')")
@PreAuthorize("hasAnyRole('admin','YXSYSTEMUSERLEVEL_ALL','YXSYSTEMUSERLEVEL_SELECT')")
public ResponseEntity getYxSystemUserLevels(YxSystemUserLevelQueryCriteria criteria, Pageable pageable){
return new ResponseEntity<>(yxSystemUserLevelService.queryAll(criteria,pageable),HttpStatus.OK);
}
@ -54,7 +54,7 @@ public class SystemUserLevelController {
@Log("新增")
@ApiOperation(value = "新增")
@PostMapping(value = "/yxSystemUserLevel")
@PreAuthorize("@el.check('admin','YXSYSTEMUSERLEVEL_ALL','YXSYSTEMUSERLEVEL_CREATE')")
@PreAuthorize("hasAnyRole('admin','YXSYSTEMUSERLEVEL_ALL','YXSYSTEMUSERLEVEL_CREATE')")
public ResponseEntity create(@Validated @RequestBody YxSystemUserLevel resources){
return new ResponseEntity<>(yxSystemUserLevelService.save(resources),HttpStatus.CREATED);
}
@ -63,7 +63,7 @@ public class SystemUserLevelController {
@Log("修改")
@ApiOperation(value = "修改")
@PutMapping(value = "/yxSystemUserLevel")
@PreAuthorize("@el.check('admin','YXSYSTEMUSERLEVEL_ALL','YXSYSTEMUSERLEVEL_EDIT')")
@PreAuthorize("hasAnyRole('admin','YXSYSTEMUSERLEVEL_ALL','YXSYSTEMUSERLEVEL_EDIT')")
public ResponseEntity update(@Validated @RequestBody YxSystemUserLevel resources){
yxSystemUserLevelService.saveOrUpdate(resources);
return new ResponseEntity(HttpStatus.NO_CONTENT);
@ -73,7 +73,7 @@ public class SystemUserLevelController {
@Log("删除")
@ApiOperation(value = "删除")
@DeleteMapping(value = "/yxSystemUserLevel/{id}")
@PreAuthorize("@el.check('admin','YXSYSTEMUSERLEVEL_ALL','YXSYSTEMUSERLEVEL_DELETE')")
@PreAuthorize("hasAnyRole('admin','YXSYSTEMUSERLEVEL_ALL','YXSYSTEMUSERLEVEL_DELETE')")
public ResponseEntity delete(@PathVariable Integer id){
yxSystemUserLevelService.removeById(id);
return new ResponseEntity(HttpStatus.OK);

View File

@ -45,7 +45,7 @@ public class SystemUserTaskController {
@Log("查询")
@ApiOperation(value = "查询")
@GetMapping(value = "/yxSystemUserTask")
@PreAuthorize("@el.check('admin','YXSYSTEMUSERTASK_ALL','YXSYSTEMUSERTASK_SELECT')")
@PreAuthorize("hasAnyRole('admin','YXSYSTEMUSERTASK_ALL','YXSYSTEMUSERTASK_SELECT')")
public ResponseEntity getYxSystemUserTasks(YxSystemUserTaskQueryCriteria criteria,
Pageable pageable){
Sort sort = new Sort(Sort.Direction.ASC, "level_id");
@ -59,7 +59,7 @@ public class SystemUserTaskController {
@Log("新增")
@ApiOperation(value = "新增")
@PostMapping(value = "/yxSystemUserTask")
@PreAuthorize("@el.check('admin','YXSYSTEMUSERTASK_ALL','YXSYSTEMUSERTASK_CREATE')")
@PreAuthorize("hasAnyRole('admin','YXSYSTEMUSERTASK_ALL','YXSYSTEMUSERTASK_CREATE')")
public ResponseEntity create(@Validated @RequestBody YxSystemUserTask resources){
return new ResponseEntity(yxSystemUserTaskService.save(resources),HttpStatus.CREATED);
}
@ -67,7 +67,7 @@ public class SystemUserTaskController {
@Log("修改")
@ApiOperation(value = "修改")
@PutMapping(value = "/yxSystemUserTask")
@PreAuthorize("@el.check('admin','YXSYSTEMUSERTASK_ALL','YXSYSTEMUSERTASK_EDIT')")
@PreAuthorize("hasAnyRole('admin','YXSYSTEMUSERTASK_ALL','YXSYSTEMUSERTASK_EDIT')")
public ResponseEntity update(@Validated @RequestBody YxSystemUserTask resources){
//if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作");
yxSystemUserTaskService.saveOrUpdate(resources);
@ -77,7 +77,7 @@ public class SystemUserTaskController {
@Log("删除")
@ApiOperation(value = "删除")
@DeleteMapping(value = "/yxSystemUserTask/{id}")
@PreAuthorize("@el.check('admin','YXSYSTEMUSERTASK_ALL','YXSYSTEMUSERTASK_DELETE')")
@PreAuthorize("hasAnyRole('admin','YXSYSTEMUSERTASK_ALL','YXSYSTEMUSERTASK_DELETE')")
public ResponseEntity delete(@PathVariable Integer id){
//if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作");
yxSystemUserTaskService.removeById(id);

View File

@ -50,14 +50,14 @@ public class WechatArticleController {
@ApiOperation(value = "查询单条信息")
@GetMapping(value = "/yxArticle/info/{id}")
@PreAuthorize("@el.check('admin','YXARTICLE_ALL','YXARTICLE_GET')")
@PreAuthorize("hasAnyRole('admin','YXARTICLE_ALL','YXARTICLE_GET')")
public ResponseEntity getInfo(@PathVariable Integer id){
return new ResponseEntity<>(yxArticleService.getById(id),HttpStatus.OK);
}
@ApiOperation(value = "查询")
@GetMapping(value = "/yxArticle")
@PreAuthorize("@el.check('admin','YXARTICLE_ALL','YXARTICLE_SELECT')")
@PreAuthorize("hasAnyRole('admin','YXARTICLE_ALL','YXARTICLE_SELECT')")
public ResponseEntity getYxArticles(YxArticleQueryCriteria criteria, Pageable pageable){
return new ResponseEntity<>(yxArticleService.queryAll(criteria,pageable),HttpStatus.OK);
}
@ -65,7 +65,7 @@ public class WechatArticleController {
@ApiOperation(value = "新增")
@PostMapping(value = "/yxArticle")
@PreAuthorize("@el.check('admin','YXARTICLE_ALL','YXARTICLE_CREATE')")
@PreAuthorize("hasAnyRole('admin','YXARTICLE_ALL','YXARTICLE_CREATE')")
public ResponseEntity create(@Validated @RequestBody YxArticle resources){
return new ResponseEntity<>(yxArticleService.save(resources),HttpStatus.CREATED);
}
@ -73,7 +73,7 @@ public class WechatArticleController {
@ApiOperation(value = "修改")
@PutMapping(value = "/yxArticle")
@PreAuthorize("@el.check('admin','YXARTICLE_ALL','YXARTICLE_EDIT')")
@PreAuthorize("hasAnyRole('admin','YXARTICLE_ALL','YXARTICLE_EDIT')")
public ResponseEntity update(@Validated @RequestBody YxArticle resources){
yxArticleService.saveOrUpdate(resources);
return new ResponseEntity(HttpStatus.NO_CONTENT);
@ -82,7 +82,7 @@ public class WechatArticleController {
@ForbidSubmit
@ApiOperation(value = "删除")
@DeleteMapping(value = "/yxArticle/{id}")
@PreAuthorize("@el.check('admin','YXARTICLE_ALL','YXARTICLE_DELETE')")
@PreAuthorize("hasAnyRole('admin','YXARTICLE_ALL','YXARTICLE_DELETE')")
public ResponseEntity delete(@PathVariable Integer id){
yxArticleService.removeById(id);
return new ResponseEntity(HttpStatus.OK);
@ -91,7 +91,7 @@ public class WechatArticleController {
@ForbidSubmit
@ApiOperation(value = "发布文章")
@GetMapping(value = "/yxArticle/publish/{id}")
@PreAuthorize("@el.check('admin','YXARTICLE_ALL','YXARTICLE_DELETE')")
@PreAuthorize("hasAnyRole('admin','YXARTICLE_ALL','YXARTICLE_DELETE')")
public ResponseEntity publish(@PathVariable Integer id) throws Exception{
YxArticleDto yxArticleDTO= new YxArticleDto();
YxArticle yxArticle = yxArticleService.getById(id);

View File

@ -49,7 +49,7 @@ public class WechatMenuController {
@ApiOperation(value = "查询菜单")
@GetMapping(value = "/YxWechatMenu")
@PreAuthorize("@el.check('admin','YxWechatMenu_ALL','YxWechatMenu_SELECT')")
@PreAuthorize("hasAnyRole('admin','YxWechatMenu_ALL','YxWechatMenu_SELECT')")
public ResponseEntity getYxWechatMenus(){
return new ResponseEntity(YxWechatMenuService.getOne(new QueryWrapper<YxWechatMenu>().lambda()
.eq(YxWechatMenu::getKey,ShopConstants.WECHAT_MENUS)),HttpStatus.OK);
@ -58,7 +58,7 @@ public class WechatMenuController {
@ForbidSubmit
@ApiOperation(value = "创建菜单")
@PostMapping(value = "/YxWechatMenu")
@PreAuthorize("@el.check('admin','YxWechatMenu_ALL','YxWechatMenu_CREATE')")
@PreAuthorize("hasAnyRole('admin','YxWechatMenu_ALL','YxWechatMenu_CREATE')")
public ResponseEntity create( @RequestBody String jsonStr){
JSONObject jsonObject = JSON.parseObject(jsonStr);
String jsonButton = jsonObject.get("buttons").toString();