Browse Source

controller修改问题

qiubo 4 years ago
parent
commit
d2002dd9c9
32 changed files with 269 additions and 214 deletions
  1. 15 0
      carbon-api-mbg/src/main/java/com/hcloud/microserver/api/domain/LoginUserDetails.java
  2. 3 4
      carbon-back/carbon-back-service/src/main/java/com/hcloud/microserver/system/bank/controller/CollectiveFarmerController.java
  3. 3 4
      carbon-back/carbon-back-service/src/main/java/com/hcloud/microserver/system/bank/controller/CompanyController.java
  4. 4 6
      carbon-back/carbon-back-service/src/main/java/com/hcloud/microserver/system/bank/controller/CustomerCompanyTypeController.java
  5. 2 4
      carbon-back/carbon-back-service/src/main/java/com/hcloud/microserver/system/bank/controller/CustomerInfoController.java
  6. 4 7
      carbon-back/carbon-back-service/src/main/java/com/hcloud/microserver/system/bank/controller/FarmerInfoController.java
  7. 2 6
      carbon-back/carbon-back-service/src/main/java/com/hcloud/microserver/system/bank/controller/GoodsInfoController.java
  8. 1 1
      carbon-back/carbon-back-service/src/main/java/com/hcloud/microserver/system/bank/controller/OrderDetailController.java
  9. 3 6
      carbon-back/carbon-back-service/src/main/java/com/hcloud/microserver/system/bank/controller/OrderInfoController.java
  10. 0 2
      carbon-back/carbon-back-service/src/main/java/com/hcloud/microserver/system/bank/controller/PayApplyController.java
  11. 0 1
      carbon-back/carbon-back-service/src/main/java/com/hcloud/microserver/system/bank/controller/PayVoucherController.java
  12. 4 6
      carbon-back/carbon-back-service/src/main/java/com/hcloud/microserver/system/bank/controller/PovertyAreaController.java
  13. 4 10
      carbon-back/carbon-back-service/src/main/java/com/hcloud/microserver/system/bank/controller/ProductInfoController.java
  14. 3 8
      carbon-back/carbon-back-service/src/main/java/com/hcloud/microserver/system/bank/controller/ProductTypeController.java
  15. 3 4
      carbon-back/carbon-back-service/src/main/java/com/hcloud/microserver/system/bank/controller/ProductTypePriceController.java
  16. 1 3
      carbon-back/carbon-back-service/src/main/java/com/hcloud/microserver/system/bank/controller/SubscriptionApplyController.java
  17. 13 3
      carbon-back/carbon-back-service/src/main/java/com/hcloud/microserver/system/bank/controller/TCarbonProblemController.java
  18. 3 4
      carbon-back/carbon-back-service/src/main/java/com/hcloud/microserver/system/bank/service/impl/TCarbonProblemServiceImpl.java
  19. 45 32
      carbon-back/carbon-back-service/src/main/java/com/hcloud/microserver/system/controller/SysProfileController.java
  20. 3 2
      carbon-back/carbon-back-service/src/main/java/com/hcloud/microserver/system/controller/token/TokenController.java
  21. 21 13
      carbon-back/carbon-back-service/src/main/java/com/hcloud/microserver/system/mapper/SysRoleMapper.java
  22. 15 7
      carbon-back/carbon-back-service/src/main/java/com/hcloud/microserver/system/mapper/SysUserRoleMapper.java
  23. 25 16
      carbon-back/carbon-back-service/src/main/java/com/hcloud/microserver/system/service/ISysRoleService.java
  24. 28 18
      carbon-back/carbon-back-service/src/main/java/com/hcloud/microserver/system/service/impl/SysRoleServiceImpl.java
  25. 23 18
      carbon-back/carbon-back-service/src/main/resources/system/SysRoleMapper.xml
  26. 13 9
      carbon-back/carbon-back-service/src/main/resources/system/SysUserRoleMapper.xml
  27. 3 0
      carbon-bank/carbon-bank-service/src/main/java/com/hcloud/microserver/system/bank/controller/MakeClearingController.java
  28. 7 7
      carbon-gateway/src/main/java/com/hcloud/microserver/gateway/filter/AuthGlobalFilter.java
  29. 13 10
      carbon-security/src/main/java/com/hcloud/microserver/security/service/TokenService.java
  30. 2 2
      common-core/src/main/java/com/hcloud/microserver/commoncore/constant/CacheConstants.java
  31. 3 1
      common-core/src/main/java/com/hcloud/microserver/commoncore/redis/RedisConfig.java
  32. BIN
      doc/carbon-platform/数据库修改.xlsx

+ 15 - 0
carbon-api-mbg/src/main/java/com/hcloud/microserver/api/domain/LoginUserDetails.java

@@ -64,4 +64,19 @@ public class LoginUserDetails implements UserDetails, Serializable {
     public LoginUser getLoginUser(){
         return loginUser;
     }
+
+    public void setLoginUser(LoginUser loginUser) {
+        this.loginUser = loginUser;
+    }
+
+    public List<String> getPermission() {
+        return permission;
+    }
+
+    public void setPermission(List<String> permission) {
+        this.permission = permission;
+    }
+    public void setAuthorities(Collection<? extends GrantedAuthority> authorities){
+
+    }
 }

+ 3 - 4
carbon-back/carbon-back-service/src/main/java/com/hcloud/microserver/system/bank/controller/CollectiveFarmerController.java

@@ -31,15 +31,14 @@ public class CollectiveFarmerController extends BaseController {
 
     @ApiOperation(value = "分页查询集体农户信息",notes = "分页查询集体农户信息")
     @PostMapping("/searchByPage")
-    @PreAuthorize(hasPermi = "system:collective:search")
     public ResponseBase<List<CollectiveFarmer>> searchByPage(@RequestBody CollectiveFarmerForm collectiveFarmerForm) {
         PageInfo<CollectiveFarmer> listByPage = this.collectiveFarmerService.getListByPage(collectiveFarmerForm);
         return responseSuccess(listByPage);
     }
 
     @ApiOperation(value = "添加集体农户信息",notes = "添加集体农户信息")
+    @PreAuthorize(hasPermi = "belongToSubject:org:add")
     @PostMapping("/save")
-    @PreAuthorize(hasPermi = "system:collective:save")
     public ResponseBase save(@RequestBody CollectiveFarmerForm collectiveFarmerForm) {
         String userId = CurrUserUtil.getUserId();
         collectiveFarmerForm.setCreateUser(userId);
@@ -52,8 +51,8 @@ public class CollectiveFarmerController extends BaseController {
     }
 
     @ApiOperation(value = "修改集体农户信息",notes = "修改集体农户信息")
+    @PreAuthorize(hasPermi = "belongToSubject:org:edit")
     @PostMapping("/update")
-    @PreAuthorize(hasPermi = "system:collective:update")
     public ResponseBase update(@RequestBody CollectiveFarmerForm collectiveFarmerForm) {
         String userId = CurrUserUtil.getUserId();
         collectiveFarmerForm.setModifiedUser(userId);
@@ -64,8 +63,8 @@ public class CollectiveFarmerController extends BaseController {
     }
 
     @ApiOperation(value = "删除集体农户信息",notes = "删除集体农户信息")
+    @PreAuthorize(hasPermi = "belongToSubject:org:del")
     @PostMapping("/delete")
-    @PreAuthorize(hasPermi = "system:collective:delete")
     public ResponseBase del(@RequestBody CollectiveFarmerForm collectiveFarmerForm) {
         int success = this.collectiveFarmerService.softRemove(collectiveFarmerForm);
         if (success> 0)

+ 3 - 4
carbon-back/carbon-back-service/src/main/java/com/hcloud/microserver/system/bank/controller/CompanyController.java

@@ -36,7 +36,6 @@ public class CompanyController extends BaseController {
     private CompanyService companyService;
 
     @ApiOperation(value = "查询企业信息")
-    @PreAuthorize(hasPermi = "system:company:query")
     @PostMapping("/searchByPage")
     public ResponseBase searchByPage(@RequestBody CustomerCompanyInfoForm customerCompanyInfoForm) {
         PageInfo pageInfo = this.customerCompanyInfoService.queryListByPage(customerCompanyInfoForm);
@@ -44,7 +43,7 @@ public class CompanyController extends BaseController {
     }
 
     @ApiOperation(value = "添加企业信息")
-    @PreAuthorize(hasPermi = "system:company:add")
+    @PreAuthorize(hasPermi = "customerManage:company:create")
     @PostMapping("/add")
     public ResponseBase addCompany(@RequestBody CustomerInfoAndCustomerCompanyInfo ccinfo) {
         log.info("前端的参数: {}", JSONObject.toJSONString(ccinfo));
@@ -68,7 +67,7 @@ public class CompanyController extends BaseController {
     }
 
     @ApiOperation(value = "修改企业信息")
-    @PreAuthorize(hasPermi = "system:company:update")
+    @PreAuthorize(hasPermi = "customerManage:company:edit")
     @PostMapping("/update")
     public ResponseBase updateCompany(@RequestBody JSONObject jsonObject) {
         log.info("前端的参数: {}", jsonObject.toJSONString());
@@ -85,7 +84,7 @@ public class CompanyController extends BaseController {
         return responseResultFailure();    }
 
     @ApiOperation(value = "删除企业信息")
-    @PreAuthorize(hasPermi = "system:company:delete")
+    @PreAuthorize(hasPermi = "customerManage:company:del")
     @PostMapping("/delete")
     public ResponseBase deleteCompany(@RequestBody JSONObject jsonObject) {
         log.info("前端的参数: {}", jsonObject.toJSONString());

+ 4 - 6
carbon-back/carbon-back-service/src/main/java/com/hcloud/microserver/system/bank/controller/CustomerCompanyTypeController.java

@@ -28,8 +28,8 @@ public class CustomerCompanyTypeController extends BaseController {
     @ApiImplicitParams({
             @ApiImplicitParam(name = "customerCompanyType",value = "企业类型信息",dataType = "CustomerCompanyType")
     })
-    @PreAuthorize(hasPermi = "system:companyType:save")
     @ApiResponse(code = 0, message = "操作成功")
+    @PreAuthorize(hasPermi = "baseManage:companyType:add")
     @PostMapping("/save")
     public ResponseBase save(@RequestBody @Valid CustomerCompanyType customerCompanyType){
         int i = customerCompanyTypeService.saveSelective(customerCompanyType);
@@ -46,8 +46,8 @@ public class CustomerCompanyTypeController extends BaseController {
     @ApiImplicitParams({
             @ApiImplicitParam(name = "customerCompanyType",value = "企业类型信息",dataType = "CustomerCompanyType")
     })
-    @PreAuthorize(hasPermi = "system:companyType:update")
     @ApiResponse(code = 0, message = "操作成功")
+    @PreAuthorize(hasPermi = "baseManage:companyType:edit")
     @PostMapping("/update")
     public ResponseBase update(@RequestBody @Valid CustomerCompanyType customerCompanyType){
         int i = customerCompanyTypeService.modifyByPrimaryKeySelective(customerCompanyType);
@@ -65,7 +65,7 @@ public class CustomerCompanyTypeController extends BaseController {
             @ApiImplicitParam(name = "guid",value = "主键",dataType = "String")
     })
     @ApiResponse(code = 0, message = "操作成功")
-    @PreAuthorize(hasPermi = "system:companyType:findById")
+    @PreAuthorize(hasPermi = "baseManage:companyType:view")
     @GetMapping("/findById")
     public ResponseBase findById(@RequestParam("guid") String guid){
         CustomerCompanyType customerCompanyType = customerCompanyTypeService.queryByPrimaryKey(guid);
@@ -79,7 +79,7 @@ public class CustomerCompanyTypeController extends BaseController {
             @ApiImplicitParam(name = "guid",value = "主键",dataType = "String")
     })
     @ApiResponse(code = 0, message = "操作成功")
-    @PreAuthorize(hasPermi = "system:companyType:delete")
+    @PreAuthorize(hasPermi = "baseManage:companyType:del")
     @GetMapping("/delete")
     public ResponseBase delete(@RequestParam("guid") String guid){
         int i = customerCompanyTypeService.delByPrimaryKey(guid);
@@ -97,7 +97,6 @@ public class CustomerCompanyTypeController extends BaseController {
             @ApiImplicitParam(name = "customerCompanyTypeForm",value = "企业类型信息",dataType = "CustomerCompanyTypeForm")
     })
     @ApiResponse(code = 0, message = "操作成功")
-    @PreAuthorize(hasPermi = "system:companyType:list")
     @PostMapping("/list")
     public ResponseBase selectList(@RequestBody CustomerCompanyTypeForm customerCompanyTypeForm){
         PageInfo<List<CustomerCompanyType>> pageInfo = customerCompanyTypeService.selectList(customerCompanyTypeForm);
@@ -109,7 +108,6 @@ public class CustomerCompanyTypeController extends BaseController {
 
     @ApiOperation(value = "企业类型全部数据")
     @ApiResponse(code = 0, message = "操作成功")
-    @PreAuthorize(hasPermi = "system:companyType:all")
     @GetMapping("/all")
     public ResponseBase selectAll(){
         CustomerCompanyTypeForm customerCompanyTypeForm = new CustomerCompanyTypeForm();

+ 2 - 4
carbon-back/carbon-back-service/src/main/java/com/hcloud/microserver/system/bank/controller/CustomerInfoController.java

@@ -36,15 +36,14 @@ public class CustomerInfoController extends BaseController {
      */
     @ApiOperation(value = "分页查询爱心用户信息")
     @PostMapping("/searchByPage")
-    @PreAuthorize(hasPermi = "system:customer:list")
     public ResponseBase searchCustomerInfoByPage(@RequestBody CustomerInfoForm customerInfoForm) {
         PageInfo pageInfo = customerInfoService.searchCustomerByPage(customerInfoForm);
         return responseSuccess(pageInfo);
     }
 
     @ApiOperation(value = "重置爱心用户密码")
+    @PreAuthorize(hasPermi = "customerManage:customers:resetpwd")
     @PostMapping("/resetPassword")
-    @PreAuthorize(hasPermi = "system:customer:resetPassword")
     public ResponseBase resetPassword(@RequestBody CustomerInfoForm customerInfoForm) {
         int i = this.customerInfoService.resetPassword(customerInfoForm);
         if (i>0){
@@ -54,7 +53,7 @@ public class CustomerInfoController extends BaseController {
     }
 
     @ApiOperation(value = "修改爱心用户信息")
-    @PreAuthorize(hasPermi = "system:customer:update")
+    @PreAuthorize(hasPermi = "customerManage:customers:uStatus")
     @PostMapping("/update")
     public ResponseBase update(@RequestBody CustomerInfoForm customerInfoForm) {
         int i = customerInfoService.modifyByPrimaryKeySelective(customerInfoForm);
@@ -69,7 +68,6 @@ public class CustomerInfoController extends BaseController {
      * @return
      */
     @ApiOperation(value = "查询客户列表")
-    @PreAuthorize(hasPermi = "system:customer:coustomerList")
     @GetMapping("/coustomer-list")
     public ResponseBase customerList(String companyName) {
         ResultVO resultVO = new ResultVO();

+ 4 - 7
carbon-back/carbon-back-service/src/main/java/com/hcloud/microserver/system/bank/controller/FarmerInfoController.java

@@ -31,14 +31,14 @@ public class FarmerInfoController extends BaseController {
 
     @ApiOperation(value = "分页查询农户信息")
     @PostMapping("/searchByPage")
-    @PreAuthorize(hasPermi = "system:farmer:search")
     public ResponseBase<List<FarmerInfo>> searchByPage(@RequestBody FarmerInfoForm farmerInfoForm) {
         PageInfo<FarmerInfo> pageInfo = this.farmerInfoService.getListByPage(farmerInfoForm);
         return responseSuccess(pageInfo);
     }
+
     @ApiOperation(value = "新增农户信息")
+    @PreAuthorize(hasPermi = "belongToSubject:people:add")
     @PostMapping("/save")
-    @PreAuthorize(hasPermi = "system:farmer:save")
     public ResponseBase save(@RequestBody FarmerInfoForm farmerInfoForm) {
         int success = this.farmerInfoService.save(farmerInfoForm);
         if (success>0){
@@ -47,8 +47,8 @@ public class FarmerInfoController extends BaseController {
         return responseResultFailure();
     }
     @ApiOperation(value = "修改农户信息")
+    @PreAuthorize(hasPermi = "belongToSubject:people:edit")
     @PostMapping("/update")
-    @PreAuthorize(hasPermi = "system:farmer:update")
     public ResponseBase update(@RequestBody FarmerInfoForm farmerInfoForm) {
         int success = this.farmerInfoService.modify(farmerInfoForm);
         if (success>0){
@@ -58,8 +58,8 @@ public class FarmerInfoController extends BaseController {
     }
 
     @ApiOperation(value = "删除农户信息")
+    @PreAuthorize(hasPermi = "belongToSubject:people:del")
     @PostMapping("/delete")
-    @PreAuthorize(hasPermi = "system:farmer:delete")
     public ResponseBase del(@RequestBody FarmerInfoForm farmerInfoForm) {
         int success = this.farmerInfoService.softRemove(farmerInfoForm);
         if (success>0){
@@ -70,7 +70,6 @@ public class FarmerInfoController extends BaseController {
 
     @ApiOperation(value = "通过集体查询农户信息")
     @PostMapping("/searchByCollectiveId")
-    @PreAuthorize(hasPermi = "system:farmer:searchByCollectiveId")
     public ResponseBase<FarmerInfo> findByCollectiveId(@RequestParam(name = "collectiveId") String collectiveId) {
         List<FarmerInfo> farmerInfos = this.farmerInfoService.queryByCollectiveId(collectiveId);
         return responseResultSuccess(farmerInfos);
@@ -78,14 +77,12 @@ public class FarmerInfoController extends BaseController {
 
     @ApiOperation(value = "通过产品查询农户信息")
     @PostMapping("/searchByProductGuid")
-    @PreAuthorize(hasPermi = "system:farmer:searchByProductGuid")
     public ResponseBase<FarmerInfo> searchByProductGuid(@RequestParam(name = "productGuid") String productGuid) {
         List<FarmerInfo> farmerInfos = this.farmerInfoService.queryByProductGuid(productGuid);
         return responseResultSuccess(farmerInfos);
     }
     @ApiOperation(value = "导入农户信息")
     @PostMapping("/import")
-    @PreAuthorize(hasPermi = "system:farmer:import")
     public ResponseBase<FarmerInfo> importFarmer(@RequestParam(value = "file") MultipartFile file) {
 
         try {

+ 2 - 6
carbon-back/carbon-back-service/src/main/java/com/hcloud/microserver/system/bank/controller/GoodsInfoController.java

@@ -34,7 +34,7 @@ public class GoodsInfoController extends BaseController {
     private GoodsInfoService goodsInfoService;
 
     @ApiOperation("商品上下架")
-    @PreAuthorize(hasPermi = "system:goods:shelves")
+    @PreAuthorize(hasPermi = "productManage:commodity:online")
     @PostMapping("/shelves")
     public ResponseBase shelves(@RequestBody List<GoodsInfoForm> goodsInfoForms) {
         int success = this.goodsInfoService.batchShelves(goodsInfoForms);
@@ -46,7 +46,7 @@ public class GoodsInfoController extends BaseController {
     }
 
     @ApiOperation("商品删除")
-    @PreAuthorize(hasPermi = "system:goods:delete")
+    @PreAuthorize(hasPermi = "productManage:commodity:del")
     @PostMapping("/delete")
     public ResponseBase delete(@RequestBody GoodsInfoForm goodsInfoForm) {
         int success = this.goodsInfoService.remove(goodsInfoForm);
@@ -57,7 +57,6 @@ public class GoodsInfoController extends BaseController {
     }
 
     @ApiOperation("修改商品信息")
-    @PreAuthorize(hasPermi = "system:goods:update")
     @PostMapping("/update")
     public ResponseBase update(@RequestBody GoodsInfoForm goodsInfoForm) {
         int success = this.goodsInfoService.modify(goodsInfoForm);
@@ -67,7 +66,6 @@ public class GoodsInfoController extends BaseController {
         return responseResultFailure();    }
 
     @ApiOperation("分页查询商品信息")
-    @PreAuthorize(hasPermi = "system:goods:searchByPage")
     @PostMapping("/searchByPage")
     public ResponseBase searchByPage(@RequestBody GoodsInfoForm goodsInfoForm) {
         PageInfo pageInfo = this.goodsInfoService.queryListByPage(goodsInfoForm);
@@ -75,7 +73,6 @@ public class GoodsInfoController extends BaseController {
 
     }
     @ApiOperation("分页查询商品关联信息")
-    @PreAuthorize(hasPermi = "system:goods:searchJoinListByPage")
     @PostMapping("/searchJoinListByPage")
     public ResponseBase searchJoinListByPage(@RequestBody GoodsInfoForm goodsInfoForm) {
         PageInfo pageInfo = this.goodsInfoService.queryJoinListByPage(goodsInfoForm);
@@ -83,7 +80,6 @@ public class GoodsInfoController extends BaseController {
     }
 
     @ApiOperation("修改商品信息")
-    @PreAuthorize(hasPermi = "system:goods:updateGoods")
     @PostMapping("/updateGoods")
     public ResponseBase modifyGoods(@RequestBody JSONObject jsonObject) {
         JSONArray jsonArray = jsonObject.getJSONArray("productInfos");

+ 1 - 1
carbon-back/carbon-back-service/src/main/java/com/hcloud/microserver/system/bank/controller/OrderDetailController.java

@@ -21,7 +21,7 @@ public class OrderDetailController extends BaseController {
     private OrderDetailInfoService orderDetailInfoService;
 
     @ApiOperation("分页查询订单详细信息")
-    @PreAuthorize(hasPermi = "system:orderDetail:searchByOrderGuid")
+    @PreAuthorize(hasPermi = "order:baseOrder:orderView")
     @GetMapping("/searchByOrderGuid")
     public ResponseBase searchByOrderGuid(@RequestParam(name = "orderGuid") String orderGuid) {
         return responseResultSuccess(this.orderDetailInfoService.findByGoodsOrderInfoGuid(orderGuid));

+ 3 - 6
carbon-back/carbon-back-service/src/main/java/com/hcloud/microserver/system/bank/controller/OrderInfoController.java

@@ -26,14 +26,13 @@ public class OrderInfoController extends BaseController {
     private OrderInfoService orderInfoService;
 
     @ApiOperation("分页查询订单信息")
-    @PreAuthorize(hasPermi = "system:order:searchByPage")
     @PostMapping("/searchByPage")
     public ResponseBase<OrderInfoBO> searchByPage(@RequestBody GoodsOrderInfoForm goodsOrderInfoForm) {
         PageInfo pageInfo = orderInfoService.searchOrderInfoByPage(goodsOrderInfoForm);
         return responseSuccess(pageInfo);
     }
     @ApiOperation("证书查看")
-    @PreAuthorize(hasPermi = "system:order:credential")
+    @PreAuthorize(hasPermi = "order:baseOrder:certView")
     @GetMapping("/credential")
     public ResponseBase<CredentialInfoBO> searchCredentialInfoBO(@RequestParam(name = "guid") String guid) {
         CredentialInfoBO credentialInfoBO = orderInfoService.searchCredentialInfo(guid);
@@ -50,7 +49,7 @@ public class OrderInfoController extends BaseController {
      *
      */
     @ApiOperation("后台创建订单")
-    @PreAuthorize(hasPermi = "system:order:createOrder")
+    @PreAuthorize(hasPermi = "order:subscription:create")
     @PostMapping("/create-order")
     public ResponseBase create(@RequestBody CreateOrderBO createOrderBO) {
         int success = this.orderInfoService.createOrder(createOrderBO);
@@ -69,7 +68,6 @@ public class OrderInfoController extends BaseController {
      */
 
     @ApiOperation("查询线下订单列表")
-    @PreAuthorize(hasPermi = "system:order:offlineList")
     @GetMapping("/offline-order-list")
     public ResponseBase<OfflineOrderBO> queryOfflineOrderList(OfflineOrderCondidtionForm condidtionForm) {
         PageInfo pageInfo = orderInfoService.offlineOrderList(condidtionForm);
@@ -84,7 +82,6 @@ public class OrderInfoController extends BaseController {
      */
 
     @ApiOperation("查询线下订单详情")
-    @PreAuthorize(hasPermi = "system:order:offlineDetail")
     @GetMapping("/offline-order-detail")
     public ResponseBase<OfflineOrderDetailBO> queryOrderDetail(String guid) {
         OfflineOrderDetailBO order = orderInfoService.queryOfflineOrderDetial(guid);
@@ -101,7 +98,7 @@ public class OrderInfoController extends BaseController {
      */
 
     @ApiOperation("收款")
-    @PreAuthorize(hasPermi = "system:order:collectMoney")
+    @PreAuthorize(hasPermi = "order:inlineOrder:realpay")
     @PutMapping("/collect-money")
     public ResponseBase collectMoney(@RequestBody OfflineOrderPayVoucherForm payVoucher) {
         int success = this.orderInfoService.collectMoneyDeal(payVoucher);

+ 0 - 2
carbon-back/carbon-back-service/src/main/java/com/hcloud/microserver/system/bank/controller/PayApplyController.java

@@ -28,7 +28,6 @@ public class PayApplyController extends BaseController {
     private OrderPayApplyService orderPayApplyService;
 
     @ApiOperation("分页查询订单支付信息")
-    @PreAuthorize(hasPermi = "system:payApply:query")
     @PostMapping("/searchByPage")
     public ResponseBase searchByPage(@RequestBody OrderPayApplyForm orderPayApplyForm) {
         PageInfo pageInfo = this.orderPayApplyService.searchByPage(orderPayApplyForm);
@@ -36,7 +35,6 @@ public class PayApplyController extends BaseController {
     }
 
     @ApiOperation("审核离线支付信息")
-    @PreAuthorize(hasPermi = "system:payApply:audit")
     @PostMapping("/audit")
     public ResponseBase audit(@RequestBody JSONObject jsonObject) {
         GoodsOrderInfoForm goodsOrderInfoForm = jsonObject.getObject("goodsOrderInfoForm", GoodsOrderInfoForm.class);

+ 0 - 1
carbon-back/carbon-back-service/src/main/java/com/hcloud/microserver/system/bank/controller/PayVoucherController.java

@@ -22,7 +22,6 @@ public class PayVoucherController extends BaseController {
     private OrderPayVoucherService orderPayVoucherService;
 
     @PostMapping("/searchByPage")
-    @PreAuthorize(hasPermi = "system:voucher:query")
     public ResponseBase searchByPage(@RequestBody OrderPayVoucherForm orderPayVoucherForm) {
         PageInfo pageInfo = orderPayVoucherService.queryListByPage(orderPayVoucherForm);
         return responseSuccess(pageInfo);

+ 4 - 6
carbon-back/carbon-back-service/src/main/java/com/hcloud/microserver/system/bank/controller/PovertyAreaController.java

@@ -28,14 +28,12 @@ public class PovertyAreaController extends BaseController {
 
     @ApiOperation("分页查询贫困区域")
     @PostMapping("/searchByPage")
-    @PreAuthorize(hasPermi = "system:poverty:searchPage")
     public ResponseBase<List<PovertyArea>> searchByPage(@RequestBody PovertyAreaForm povertyAreaForm) {
         PageInfo<PovertyArea> list = this.povertyAreaService.getListByPage(povertyAreaForm);
         return responseSuccess(list);
     }
 
     @ApiOperation("查询贫困区域")
-    @PreAuthorize(hasPermi = "system:poverty:search")
     @GetMapping("/search")
     public ResponseBase<List<PovertyArea>> search(@ApiParam("区域名称")@RequestParam(value = "name",required = true) String name) {
         List<PovertyArea> list = this.povertyAreaService.listAll(name);
@@ -43,7 +41,7 @@ public class PovertyAreaController extends BaseController {
     }
 
     @ApiOperation("新增贫困区域")
-    @PreAuthorize(hasPermi = "system:poverty:save")
+    @PreAuthorize(hasPermi = "belongToSubject:area:add")
     @PostMapping("/save")
     public ResponseBase save(@RequestBody PovertyAreaForm povertyAreaForm) {
 
@@ -57,7 +55,7 @@ public class PovertyAreaController extends BaseController {
     }
 
     @ApiOperation("修改贫困区域")
-    @PreAuthorize(hasPermi = "system:poverty:update")
+    @PreAuthorize(hasPermi = "belongToSubject:area:del\n")
     @PostMapping("/update")
     public ResponseBase update(@RequestBody PovertyAreaForm povertyAreaForm) {
         int success = this.povertyAreaService.modify(povertyAreaForm);
@@ -68,7 +66,7 @@ public class PovertyAreaController extends BaseController {
     }
 
     @ApiOperation("删除贫困区域")
-    @PreAuthorize(hasPermi = "system:poverty:delete")
+    @PreAuthorize(hasPermi = "belongToSubject:area:del\n")
     @PostMapping("/del")
     public ResponseBase del(@RequestBody PovertyAreaForm povertyAreaForm) {
         int success = this.povertyAreaService.remove(povertyAreaForm);
@@ -79,7 +77,7 @@ public class PovertyAreaController extends BaseController {
     }
 
     @ApiOperation("查询贫困区域明细")
-    @PreAuthorize(hasPermi = "system:poverty:info")
+    @PreAuthorize(hasPermi = "belongToSubject:area:view")
     @GetMapping("/findByGuid")
     public ResponseBase<PovertyArea> findByGuid(@RequestParam(name = "guid") String guid) {
         PovertyArea povertyArea = this.povertyAreaService.findByGuid(guid);

+ 4 - 10
carbon-back/carbon-back-service/src/main/java/com/hcloud/microserver/system/bank/controller/ProductInfoController.java

@@ -42,7 +42,7 @@ public class ProductInfoController extends CarbonBaseController {
     private ProductBelongService productBelongService;
 
     @ApiOperation("保存")
-    @PreAuthorize(hasPermi = "system:productInfo:save")
+    @PreAuthorize(hasPermi = "productManage:productInfo:add")
     @PostMapping("/save")
     public ResponseBase save(@RequestBody @Valid ProductInfoForm productInfoForm) {
         int success = this.productInfoService.save(productInfoForm);
@@ -51,7 +51,7 @@ public class ProductInfoController extends CarbonBaseController {
     }
 
     @ApiOperation("删除产品")
-    @PreAuthorize(hasPermi = "system:productInfo:delete")
+    @PreAuthorize(hasPermi = "productManage:productInfo:del")
     @PostMapping("/delete")
     public ResponseBase delete(@RequestBody ProductInfoForm productInfoForm) {
         int success = this.productInfoService.remove(productInfoForm);
@@ -59,7 +59,7 @@ public class ProductInfoController extends CarbonBaseController {
     }
 
     @ApiOperation("修改产品")
-    @PreAuthorize(hasPermi = "system:productInfo:update")
+    @PreAuthorize(hasPermi = "productManage:productInfo:edit")
     @PostMapping("/update")
     public ResponseBase update(@RequestBody @Valid ProductInfoForm productInfoForm) {
         int success = this.productInfoService.modify(productInfoForm);
@@ -67,7 +67,6 @@ public class ProductInfoController extends CarbonBaseController {
     }
 
     @ApiOperation("分页获取产品")
-    @PreAuthorize(hasPermi = "system:productInfo:searchByPage")
     @PostMapping("/searchByPage")
     public ResponseBase searchByPage(@RequestBody ProductInfoForm productInfoForm) {
         PageInfo pageInfo = this.productInfoService.queryListByPage(productInfoForm);
@@ -75,7 +74,6 @@ public class ProductInfoController extends CarbonBaseController {
     }
 
     @ApiOperation("获取产品属性扩展")
-    @PreAuthorize(hasPermi = "system:productInfo:expansions")
     @PostMapping("/expansions")
     public ResponseBase expansions(@RequestParam("guid") String guid) {
         List<ProductExpansion> expansions = this.productExpansionService.searchByProductGuid(guid);
@@ -83,7 +81,6 @@ public class ProductInfoController extends CarbonBaseController {
     }
 
     @ApiOperation("获取产品属性")
-    @PreAuthorize(hasPermi = "system:productInfo:belongs")
     @PostMapping("/belongs")
     public ResponseBase belongs(@RequestParam("guid") String guid) {
         List<ProductBelong> belongs = productBelongService.searchByProductGuid(guid);
@@ -91,7 +88,7 @@ public class ProductInfoController extends CarbonBaseController {
     }
 
     @ApiOperation("发布产品")
-    @PreAuthorize(hasPermi = "system:productInfo:publish")
+    @PreAuthorize(hasPermi = "productManage:productInfo:create")
     @PostMapping("/publish")
     public ResponseBase publish(@RequestBody JSONObject jsonObject) {
         log.info("参数: {}", jsonObject);
@@ -118,7 +115,6 @@ public class ProductInfoController extends CarbonBaseController {
     }
 
     @ApiOperation("发布商品")
-    @PreAuthorize(hasPermi = "system:productInfo:publishGoods")
     @PostMapping("/publishGoods")
     public ResponseBase publishGoods(@RequestBody JSONObject jsonObject) {
         log.info("参数: {}", jsonObject.toJSONString());
@@ -152,7 +148,6 @@ public class ProductInfoController extends CarbonBaseController {
     }
 
     @ApiOperation("获取商品详细信息")
-    @PreAuthorize(hasPermi = "system:productInfo:findByGoodsInfoGuid")
     @PostMapping("/findByGoodsInfoGuid")
     public ResponseBase findByGoodsInfoGuid(@RequestParam("goodsInfoGuid") String goodsInfoGuid) {
         List<ProductInfo> productInfos = this.productInfoService.searchByGoodsInfoGuid(goodsInfoGuid);
@@ -160,7 +155,6 @@ public class ProductInfoController extends CarbonBaseController {
     }
 
     @ApiOperation("获取产品详细信息")
-    @PreAuthorize(hasPermi = "system:productInfo:findByProductInfoGuid")
     @GetMapping("/findByProductInfoGuid")
     public ResponseBase findByProductInfoGuid(@RequestParam("productGuid") String productGuid) {
         ProductInfo productInfos = this.productInfoService.findById(productGuid);

+ 3 - 8
carbon-back/carbon-back-service/src/main/java/com/hcloud/microserver/system/bank/controller/ProductTypeController.java

@@ -34,7 +34,7 @@ public class ProductTypeController extends CarbonBaseController {
     private ProductTypeExpansionService productTypeExpansionService;
 
     @ApiOperation("产品类型保存")
-    @PreAuthorize(hasPermi = "system:productType:save")
+    @PreAuthorize(hasPermi = "baseManage:productType:add")
     @PostMapping("/save")
     public ResponseBase save(@RequestBody ProductTypeForm productTypeForm) {
         int success = this.productTypeService.add(productTypeForm);
@@ -42,7 +42,7 @@ public class ProductTypeController extends CarbonBaseController {
     }
 
     @ApiOperation("删除产品类型")
-    @PreAuthorize(hasPermi = "system:productType:delete")
+    @PreAuthorize(hasPermi = "baseManage:productType:del")
     @PostMapping("/delete")
     public ResponseBase delete(@RequestBody ProductTypeForm productTypeForm) {
         int success = this.productTypeService.remove(productTypeForm);
@@ -50,7 +50,7 @@ public class ProductTypeController extends CarbonBaseController {
     }
 
     @ApiOperation("修改产品类型")
-    @PreAuthorize(hasPermi = "system:productType:update")
+    @PreAuthorize(hasPermi = "baseManage:productType:edit")
     @PostMapping("/update")
     public ResponseBase update(@RequestBody ProductTypeForm productTypeForm) {
         int success = this.productTypeService.modify(productTypeForm);
@@ -58,7 +58,6 @@ public class ProductTypeController extends CarbonBaseController {
     }
 
     @ApiOperation("分页获取产品类型")
-    @PreAuthorize(hasPermi = "system:productType:searchByPage")
     @PostMapping("/searchByPage")
     public ResponseBase searchByPage(@RequestBody ProductTypeForm productTypeForm) {
         PageInfo pageInfo = this.productTypeService.queryListByPage(productTypeForm);
@@ -66,7 +65,6 @@ public class ProductTypeController extends CarbonBaseController {
     }
 
     @ApiOperation("产品类型扩展")
-    @PreAuthorize(hasPermi = "system:productType:expansions")
     @PostMapping("/expansions")
     public ResponseBase expansions(@RequestParam(name = "guid") String guid) {
         log.info("web =====> guid: {}", guid);
@@ -75,14 +73,12 @@ public class ProductTypeController extends CarbonBaseController {
     }
 
     @ApiOperation("查询所有产品类型")
-    @PreAuthorize(hasPermi = "system:productType:all")
     @PostMapping("/all")
     public ResponseBase all(@RequestBody(required = false) ProductTypeForm productTypeForm) {
         List<ProductType> productTypes = this.productTypeService.queryAll(productTypeForm);
         return responseResultSuccess(productTypes);
     }
 
-    @PreAuthorize(hasPermi = "system:productType:checkTypeVal")
     @ApiOperation("校验产品类型值")
     @PostMapping("/checkTypeVal")
     public ResponseBase checkTypeVal(@RequestParam(name = "typeVal") String typeVal) {
@@ -94,7 +90,6 @@ public class ProductTypeController extends CarbonBaseController {
     }
 
     @ApiOperation("查询所有产品类型2")
-    @PreAuthorize(hasPermi = "system:productType:getAll")
     @GetMapping("/all")
     public ResponseBase getAll() {
         List<Map> list = this.productTypeService.getAll();

+ 3 - 4
carbon-back/carbon-back-service/src/main/java/com/hcloud/microserver/system/bank/controller/ProductTypePriceController.java

@@ -28,7 +28,7 @@ public class ProductTypePriceController extends BaseController {
             @ApiImplicitParam(name = "productTypePriceWithBLOBs",value = "类型定价信息",dataType = "ProductTypePriceWithBLOBs")
     })
     @ApiResponse(code = 0, message = "操作成功")
-    @PreAuthorize(hasPermi = "system:productTypePrice:save")
+    @PreAuthorize(hasPermi = "productManage:priceManage:add")
     @PostMapping("/save")
     public ResponseBase save(@RequestBody @Valid ProductTypePriceWithBLOBs productTypePriceWithBLOBs){
         int i = productTypePriceService.saveSelective(productTypePriceWithBLOBs);
@@ -42,7 +42,6 @@ public class ProductTypePriceController extends BaseController {
     @ApiImplicitParams({
             @ApiImplicitParam(name = "productTypePriceForm",value = "类型定价信息",dataType = "ProductTypePriceForm")
     })
-    @PreAuthorize(hasPermi = "system:productTypePrice:list")
     @ApiResponse(code = 0, message = "操作成功")
     @PostMapping("/list")
     public ResponseBase list(@RequestBody ProductTypePriceForm form){
@@ -54,8 +53,8 @@ public class ProductTypePriceController extends BaseController {
     @ApiImplicitParams({
             @ApiImplicitParam(name = "guid",value = "主键",dataType = "String")
     })
-    @PreAuthorize(hasPermi = "system:productTypePrice:delete")
     @ApiResponse(code = 0, message = "操作成功")
+    @PreAuthorize(hasPermi = "productManage:priceManage:del")
     @GetMapping("/delete")
     public ResponseBase delete(@RequestParam("guid") String guid){
         int i = productTypePriceService.delByPrimaryKey(guid);
@@ -69,8 +68,8 @@ public class ProductTypePriceController extends BaseController {
     @ApiImplicitParams({
             @ApiImplicitParam(name = "productTypePriceWithBLOBs",value = "类型定价信息",dataType = "ProductTypePriceWithBLOBs")
     })
-    @PreAuthorize(hasPermi = "system:productTypePrice:check")
     @ApiResponse(code = 0, message = "操作成功")
+    @PreAuthorize(hasPermi = "productManage:priceManage:check")
     @PostMapping("/check")
     public ResponseBase check(@RequestBody ProductTypePriceWithBLOBs productTypePriceWithBLOBs){
         if (productTypePriceWithBLOBs.getCheckState() < 1){

+ 1 - 3
carbon-back/carbon-back-service/src/main/java/com/hcloud/microserver/system/bank/controller/SubscriptionApplyController.java

@@ -37,7 +37,6 @@ public class SubscriptionApplyController extends BaseController
      */
     @ApiResponse(code =0,message = "查询成功")
     @GetMapping("/list")
-    @PreAuthorize(hasPermi = "system:subscriptionApply:list")
     @ApiOperation("查询认购申请列表")
     public ResponseBase<SubscriptionApply> list(SubscriptionApply subscriptionApply)
     {
@@ -50,7 +49,6 @@ public class SubscriptionApplyController extends BaseController
      * 获取碳汇认购申请详细信息
      */
     @GetMapping(value = "/{guid}")
-    @PreAuthorize(hasPermi = "system:subscriptionApply:info")
     @ApiOperation("获取认购申请详情")
     public ResponseBase getInfo(@PathVariable("guid") String guid)
     {
@@ -63,7 +61,7 @@ public class SubscriptionApplyController extends BaseController
      */
 
 	@DeleteMapping("/{guids}")
-    @PreAuthorize(hasPermi = "system:subscriptionApply:remove")
+    @PreAuthorize(hasPermi = "order:subscription:del")
     @ApiOperation("逻辑删除认购申请")
     public ResponseBase remove(@PathVariable String[] guids)
     {

+ 13 - 3
carbon-back/carbon-back-service/src/main/java/com/hcloud/microserver/system/bank/controller/TCarbonProblemController.java

@@ -24,7 +24,7 @@ public class TCarbonProblemController extends BaseController {
     private TCarbonProblemService service;
 
     @ApiOperation("常见问题添加")
-    @PutMapping
+    @PostMapping
     public ResponseBase add(@RequestBody TCarbonProblem problem){
         Long aLong = service.addProblem(problem);
         if (aLong != null){
@@ -34,7 +34,7 @@ public class TCarbonProblemController extends BaseController {
     }
 
     @ApiOperation("常见问题修改")
-    @PostMapping("update")
+    @PutMapping
     public ResponseBase update(@RequestBody TCarbonProblem problem){
         Integer update = service.update(problem);
         if (update != null){
@@ -63,7 +63,7 @@ public class TCarbonProblemController extends BaseController {
         return responseResultFailure();
     }
 
-    @ApiOperation("常见问题详细信息")
+    @ApiOperation("常见问题激活或禁用")
     @GetMapping("disen")
     public ResponseBase disable(@RequestParam(value = "guid",required = true)Long guid,
                                                 @RequestParam(value = "state")Integer state){
@@ -74,6 +74,16 @@ public class TCarbonProblemController extends BaseController {
         return responseResultFailure();
     }
 
+    @ApiOperation("删除")
+    @DeleteMapping
+    public ResponseBase<TCarbonProblem> delete(@RequestParam(value = "guid",required = true)Long guid){
+        Integer delete = service.delete(guid);
+        if (delete != null){
+            return responseResultSuccess();
+        }
+        return responseResultFailure();
+    }
+
 
 
 }

+ 3 - 4
carbon-back/carbon-back-service/src/main/java/com/hcloud/microserver/system/bank/service/impl/TCarbonProblemServiceImpl.java

@@ -25,12 +25,11 @@ public class TCarbonProblemServiceImpl implements TCarbonProblemService {
     @Override
     public Long addProblem(TCarbonProblem tCarbonProblem) {
         if (tCarbonProblem != null){
-
-            tCarbonProblem.setState(0);
             tCarbonProblem.setCreateId(tokenService.getLoginUser().getUserid());
             tCarbonProblem.setCreateName(tokenService.getLoginUser().getUsername());
-            carbonProblemMapper.insert(tCarbonProblem);
             tCarbonProblem.setCreateTime(new Date());
+            carbonProblemMapper.insert(tCarbonProblem);
+
             return tCarbonProblem.getGuid();
         }
         return null;
@@ -40,10 +39,10 @@ public class TCarbonProblemServiceImpl implements TCarbonProblemService {
     public PageInfo<TCarbonProblem> list(TCarbonProblemForm form) {
         PageHelper.startPage(form.getPageNo(),form.getPageSize());
         TCarbonProblemExample example = new TCarbonProblemExample();
-
         if (form != null){
             example = form.example();
         }
+        example.setOrderByClause("createTime desc");
         List<TCarbonProblem> tCarbonProblems = carbonProblemMapper.selectByExampleWithBLOBs(example);
         return new PageInfo<>(tCarbonProblems);
     }

+ 45 - 32
carbon-back/carbon-back-service/src/main/java/com/hcloud/microserver/system/controller/SysProfileController.java

@@ -1,6 +1,12 @@
 package com.hcloud.microserver.system.controller;
 
 
+import cn.hutool.core.util.RandomUtil;
+import com.hcloud.microserver.commoncore.util.FileUtil;
+import com.hcloud.microserver.commoncore.util.OrderNo;
+import com.hcloud.microserver.commoncore.util.ServletUtils;
+import com.hcloud.microserver.commoncore.util.UploadFileUtil;
+import com.hcloud.microserver.commoncore.util.string.StringUtils;
 import com.hcloud.microserver.commoncore.web.controller.RyBaseController;
 import  com.hcloud.microserver.commoncore.web.domain.AjaxResult;
 import com.hcloud.microserver.security.service.TokenService;
@@ -12,10 +18,13 @@ import com.hcloud.microserver.api.domain.LoginUser;
 import com.hcloud.microserver.system.service.ISysUserService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.io.IOException;
 
 /**
  * 个人信息 业务处理
- * 
+ *
  * @author ruoyi
  */
 @RestController
@@ -24,10 +33,10 @@ public class SysProfileController extends RyBaseController
 {
     @Autowired
     private ISysUserService userService;
-    
+
     @Autowired
     private TokenService tokenService;
-    
+
 //    @Autowired
 //    private RemoteFileService remoteFileService;
 
@@ -55,6 +64,7 @@ public class SysProfileController extends RyBaseController
         if (userService.updateUserProfile(user) > 0)
         {
             LoginUser loginUser = tokenService.getLoginUser();
+//            LoginUser loginUser = tokenService.getLoginUser();
             // 更新缓存用户信息
             loginUser.getSysUser().setNickName(user.getNickName());
             loginUser.getSysUser().setPhonenumber(user.getPhonenumber());
@@ -94,33 +104,36 @@ public class SysProfileController extends RyBaseController
         }
         return AjaxResult.error("修改密码异常,请联系管理员");
     }
-    
-//    /**
-//     * 头像上传
-//     */
-//    @Log(title = "用户头像", businessType = BusinessType.UPDATE)
-//    @PostMapping("/avatar")
-//    public AjaxResult avatar(@RequestParam("avatarfile") MultipartFile file) throws IOException
-//    {
-//        if (!file.isEmpty())
-//        {
-//            LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-//            R<SysFile> fileResult = remoteFileService.upload(file);
-//            if (StringUtils.isNull(fileResult) || StringUtils.isNull(fileResult.getData()))
-//            {
-//                return AjaxResult.error("文件服务异常,请联系管理员");
-//            }
-//            String url = fileResult.getData().getUrl();
-//            if (userService.updateUserAvatar(loginUser.getUsername(), url))
-//            {
-//                AjaxResult ajax = AjaxResult.success();
-//                ajax.put("imgUrl", url);
-//                // 更新缓存用户头像
-//                loginUser.getSysUser().setAvatar(url);
-//                tokenService.setLoginUser(loginUser);
-//                return ajax;
-//            }
-//        }
-//        return AjaxResult.error("上传图片异常,请联系管理员");
-//    }
+    @Autowired
+    private UploadFileUtil uploadFileUtil;
+
+    /**
+     * 头像上传
+     */
+    @Log(title = "用户头像", businessType = BusinessType.UPDATE)
+    @PostMapping("/avatar")
+    public AjaxResult avatar(@RequestParam("avatarfile") MultipartFile file) throws IOException
+    {
+        if (!file.isEmpty())
+        {
+            LoginUser loginUser = tokenService.getLoginUser();
+            String type =1+ RandomUtil.randomNumbers(1);
+            String s = uploadFileUtil.uploadQiNiuFiles(file, "cqcarbon/touxiang/" + type + "/" + OrderNo.NextOrderNo());
+            if (StringUtils.isEmpty(s) )
+            {
+                return AjaxResult.error("文件服务异常,请联系管理员");
+            }
+            String url = s;
+            if (userService.updateUserAvatar(loginUser.getUsername(), url))
+            {
+                AjaxResult ajax = AjaxResult.success();
+                ajax.put("imgUrl", url);
+                // 更新缓存用户头像
+                loginUser.getSysUser().setAvatar(url);
+                tokenService.setLoginUser(loginUser);
+                return ajax;
+            }
+        }
+        return AjaxResult.error("上传图片异常,请联系管理员");
+    }
 }

+ 3 - 2
carbon-back/carbon-back-service/src/main/java/com/hcloud/microserver/system/controller/token/TokenController.java

@@ -1,5 +1,6 @@
 package com.hcloud.microserver.system.controller.token;
 
+import com.alibaba.fastjson.JSONObject;
 import com.anji.captcha.model.common.ResponseModel;
 import com.anji.captcha.model.vo.CaptchaVO;
 import com.anji.captcha.service.CaptchaService;
@@ -22,7 +23,7 @@ import java.util.Map;
 
 /**
  * token 控制
- * 
+ *
  * @author ruoyi
  */
 @RestController
@@ -63,7 +64,7 @@ public class TokenController
         Map<String,Object> map = tokenService.createCarbonToken(userInfo);
         String access_token = map.get("access_token").toString();
         loginUserManagerCacheService.setToken(userInfo.getUsername(), tokenHead+access_token);
-        systemRedisService.set(CacheConstants.LOGIN_USER_INFO+userInfo.getUsername(),userInfo.getLoginUser().getSysUser());
+        systemRedisService.set(CacheConstants.LOGIN_USER_INFO+userInfo.getUsername(), JSONObject.toJSONString(userInfo.getLoginUser().getSysUser()));
         return R.ok(tokenService.createCarbonToken(userInfo));
     }
 

+ 21 - 13
carbon-back/carbon-back-service/src/main/java/com/hcloud/microserver/system/mapper/SysRoleMapper.java

@@ -6,14 +6,14 @@ import java.util.List;
 
 /**
  * 角色表 数据层
- * 
+ *
  * @author ruoyi
  */
 public interface SysRoleMapper
 {
     /**
      * 根据条件分页查询角色数据
-     * 
+     *
      * @param role 角色信息
      * @return 角色数据集合信息
      */
@@ -21,7 +21,7 @@ public interface SysRoleMapper
 
     /**
      * 根据用户ID查询角色
-     * 
+     *
      * @param userId 用户ID
      * @return 角色列表
      */
@@ -29,14 +29,14 @@ public interface SysRoleMapper
 
     /**
      * 查询所有角色
-     * 
+     *
      * @return 角色列表
      */
     public List<SysRole> selectRoleAll();
 
     /**
      * 根据用户ID获取角色选择框列表
-     * 
+     *
      * @param userId 用户ID
      * @return 选中角色ID列表
      */
@@ -44,15 +44,23 @@ public interface SysRoleMapper
 
     /**
      * 通过角色ID查询角色
-     * 
+     *
      * @param roleId 角色ID
      * @return 角色对象信息
      */
     public SysRole selectRoleById(Long roleId);
 
+    /**
+     * 校验角色信息
+     *
+     * @param roleId 角色ID
+     * @return 角色对象信息
+     */
+    public SysRole checkRoleById(Long roleId);
+
     /**
      * 根据用户ID查询角色
-     * 
+     *
      * @param userName 用户名
      * @return 角色列表
      */
@@ -60,7 +68,7 @@ public interface SysRoleMapper
 
     /**
      * 校验角色名称是否唯一
-     * 
+     *
      * @param roleName 角色名称
      * @return 角色信息
      */
@@ -68,7 +76,7 @@ public interface SysRoleMapper
 
     /**
      * 校验角色权限是否唯一
-     * 
+     *
      * @param roleKey 角色权限
      * @return 角色信息
      */
@@ -76,7 +84,7 @@ public interface SysRoleMapper
 
     /**
      * 修改角色信息
-     * 
+     *
      * @param role 角色信息
      * @return 结果
      */
@@ -84,7 +92,7 @@ public interface SysRoleMapper
 
     /**
      * 新增角色信息
-     * 
+     *
      * @param role 角色信息
      * @return 结果
      */
@@ -92,7 +100,7 @@ public interface SysRoleMapper
 
     /**
      * 通过角色ID删除角色
-     * 
+     *
      * @param roleId 角色ID
      * @return 结果
      */
@@ -100,7 +108,7 @@ public interface SysRoleMapper
 
     /**
      * 批量删除角色信息
-     * 
+     *
      * @param roleIds 需要删除的角色ID
      * @return 结果
      */

+ 15 - 7
carbon-back/carbon-back-service/src/main/java/com/hcloud/microserver/system/mapper/SysUserRoleMapper.java

@@ -7,14 +7,14 @@ import java.util.List;
 
 /**
  * 用户与角色关联表 数据层
- * 
+ *
  * @author ruoyi
  */
 public interface SysUserRoleMapper
 {
     /**
      * 通过用户ID删除用户和角色关联
-     * 
+     *
      * @param userId 用户ID
      * @return 结果
      */
@@ -22,7 +22,7 @@ public interface SysUserRoleMapper
 
     /**
      * 批量删除用户和角色关联
-     * 
+     *
      * @param ids 需要删除的数据ID
      * @return 结果
      */
@@ -30,15 +30,23 @@ public interface SysUserRoleMapper
 
     /**
      * 通过角色ID查询角色使用数量
-     * 
+     *
      * @param roleId 角色ID
      * @return 结果
      */
     public int countUserRoleByRoleId(Long roleId);
 
+    /**
+     * 通过角色ID查询角色没有被删除的使用数量
+     *
+     * @param roleId 角色ID
+     * @return 结果
+     */
+    public int countUserRoleNotDelByRoleId(Long roleId);
+
     /**
      * 批量新增用户角色信息
-     * 
+     *
      * @param userRoleList 用户角色列表
      * @return 结果
      */
@@ -46,7 +54,7 @@ public interface SysUserRoleMapper
 
     /**
      * 删除用户和角色关联信息
-     * 
+     *
      * @param userRole 用户和角色关联信息
      * @return 结果
      */
@@ -54,7 +62,7 @@ public interface SysUserRoleMapper
 
     /**
      * 批量取消授权用户角色
-     * 
+     *
      * @param roleId 角色ID
      * @param userIds 需要删除的用户数据ID
      * @return 结果

+ 25 - 16
carbon-back/carbon-back-service/src/main/java/com/hcloud/microserver/system/service/ISysRoleService.java

@@ -7,14 +7,14 @@ import java.util.Set;
 
 /**
  * 角色业务层
- * 
+ *
  * @author ruoyi
  */
 public interface ISysRoleService
 {
     /**
      * 根据条件分页查询角色数据
-     * 
+     *
      * @param role 角色信息
      * @return 角色数据集合信息
      */
@@ -22,7 +22,7 @@ public interface ISysRoleService
 
     /**
      * 根据用户ID查询角色
-     * 
+     *
      * @param userId 用户ID
      * @return 权限列表
      */
@@ -30,14 +30,14 @@ public interface ISysRoleService
 
     /**
      * 查询所有角色
-     * 
+     *
      * @return 角色列表
      */
     public List<SysRole> selectRoleAll();
 
     /**
      * 根据用户ID获取角色选择框列表
-     * 
+     *
      * @param userId 用户ID
      * @return 选中角色ID列表
      */
@@ -45,15 +45,22 @@ public interface ISysRoleService
 
     /**
      * 通过角色ID查询角色
-     * 
+     *
      * @param roleId 角色ID
      * @return 角色对象信息
      */
     public SysRole selectRoleById(Long roleId);
+    /**
+     * 通过角色ID查询角色
+     *
+     * @param roleId 角色ID
+     * @return 角色对象信息
+     */
+    public SysRole checkRoleById(Long roleId);
 
     /**
      * 校验角色名称是否唯一
-     * 
+     *
      * @param role 角色信息
      * @return 结果
      */
@@ -61,7 +68,7 @@ public interface ISysRoleService
 
     /**
      * 校验角色权限是否唯一
-     * 
+     *
      * @param role 角色信息
      * @return 结果
      */
@@ -69,22 +76,24 @@ public interface ISysRoleService
 
     /**
      * 校验角色是否允许操作
-     * 
+     *
      * @param role 角色信息
      */
     public void checkRoleAllowed(SysRole role);
 
     /**
      * 通过角色ID查询角色使用数量
-     * 
+     *
      * @param roleId 角色ID
      * @return 结果
      */
     public int countUserRoleByRoleId(Long roleId);
 
+    public int countUserRoleNotDelByRoleId(Long roleId);
+
     /**
      * 新增保存角色信息
-     * 
+     *
      * @param role 角色信息
      * @return 结果
      */
@@ -92,7 +101,7 @@ public interface ISysRoleService
 
     /**
      * 修改保存角色信息
-     * 
+     *
      * @param role 角色信息
      * @return 结果
      */
@@ -100,7 +109,7 @@ public interface ISysRoleService
 
     /**
      * 修改角色状态
-     * 
+     *
      * @param role 角色信息
      * @return 结果
      */
@@ -108,7 +117,7 @@ public interface ISysRoleService
 
     /**
      * 修改数据权限信息
-     * 
+     *
      * @param role 角色信息
      * @return 结果
      */
@@ -116,7 +125,7 @@ public interface ISysRoleService
 
     /**
      * 通过角色ID删除角色
-     * 
+     *
      * @param roleId 角色ID
      * @return 结果
      */
@@ -124,7 +133,7 @@ public interface ISysRoleService
 
     /**
      * 批量删除角色信息
-     * 
+     *
      * @param roleIds 需要删除的角色ID
      * @return 结果
      */

+ 28 - 18
carbon-back/carbon-back-service/src/main/java/com/hcloud/microserver/system/service/impl/SysRoleServiceImpl.java

@@ -21,7 +21,7 @@ import java.util.*;
 
 /**
  * 角色 业务层处理
- * 
+ *
  * @author ruoyi
  */
 @Service
@@ -41,7 +41,7 @@ public class SysRoleServiceImpl implements ISysRoleService
 
     /**
      * 根据条件分页查询角色数据
-     * 
+     *
      * @param role 角色信息
      * @return 角色数据集合信息
      */
@@ -54,7 +54,7 @@ public class SysRoleServiceImpl implements ISysRoleService
 
     /**
      * 根据用户ID查询权限
-     * 
+     *
      * @param userId 用户ID
      * @return 权限列表
      */
@@ -75,7 +75,7 @@ public class SysRoleServiceImpl implements ISysRoleService
 
     /**
      * 查询所有角色
-     * 
+     *
      * @return 角色列表
      */
     @Override
@@ -86,7 +86,7 @@ public class SysRoleServiceImpl implements ISysRoleService
 
     /**
      * 根据用户ID获取角色选择框列表
-     * 
+     *
      * @param userId 用户ID
      * @return 选中角色ID列表
      */
@@ -98,7 +98,7 @@ public class SysRoleServiceImpl implements ISysRoleService
 
     /**
      * 通过角色ID查询角色
-     * 
+     *
      * @param roleId 角色ID
      * @return 角色对象信息
      */
@@ -108,9 +108,14 @@ public class SysRoleServiceImpl implements ISysRoleService
         return roleMapper.selectRoleById(roleId);
     }
 
+    @Override
+    public SysRole checkRoleById(Long roleId) {
+        return roleMapper.checkRoleById(roleId);
+    }
+
     /**
      * 校验角色名称是否唯一
-     * 
+     *
      * @param role 角色信息
      * @return 结果
      */
@@ -128,7 +133,7 @@ public class SysRoleServiceImpl implements ISysRoleService
 
     /**
      * 校验角色权限是否唯一
-     * 
+     *
      * @param role 角色信息
      * @return 结果
      */
@@ -146,7 +151,7 @@ public class SysRoleServiceImpl implements ISysRoleService
 
     /**
      * 校验角色是否允许操作
-     * 
+     *
      * @param role 角色信息
      */
     @Override
@@ -160,7 +165,7 @@ public class SysRoleServiceImpl implements ISysRoleService
 
     /**
      * 通过角色ID查询角色使用数量
-     * 
+     *
      * @param roleId 角色ID
      * @return 结果
      */
@@ -170,9 +175,14 @@ public class SysRoleServiceImpl implements ISysRoleService
         return userRoleMapper.countUserRoleByRoleId(roleId);
     }
 
+    @Override
+    public int countUserRoleNotDelByRoleId(Long roleId) {
+        return userRoleMapper.countUserRoleNotDelByRoleId(roleId);
+    }
+
     /**
      * 新增保存角色信息
-     * 
+     *
      * @param role 角色信息
      * @return 结果
      */
@@ -187,7 +197,7 @@ public class SysRoleServiceImpl implements ISysRoleService
 
     /**
      * 修改保存角色信息
-     * 
+     *
      * @param role 角色信息
      * @return 结果
      */
@@ -204,7 +214,7 @@ public class SysRoleServiceImpl implements ISysRoleService
 
     /**
      * 修改角色状态
-     * 
+     *
      * @param role 角色信息
      * @return 结果
      */
@@ -216,7 +226,7 @@ public class SysRoleServiceImpl implements ISysRoleService
 
     /**
      * 修改数据权限信息
-     * 
+     *
      * @param role 角色信息
      * @return 结果
      */
@@ -234,7 +244,7 @@ public class SysRoleServiceImpl implements ISysRoleService
 
     /**
      * 新增角色菜单信息
-     * 
+     *
      * @param role 角色对象
      */
     public int insertRoleMenu(SysRole role)
@@ -282,7 +292,7 @@ public class SysRoleServiceImpl implements ISysRoleService
 
     /**
      * 通过角色ID删除角色
-     * 
+     *
      * @param roleId 角色ID
      * @return 结果
      */
@@ -294,7 +304,7 @@ public class SysRoleServiceImpl implements ISysRoleService
 
     /**
      * 批量删除角色信息
-     * 
+     *
      * @param roleIds 需要删除的角色ID
      * @return 结果
      */
@@ -305,7 +315,7 @@ public class SysRoleServiceImpl implements ISysRoleService
         {
             checkRoleAllowed(new SysRole(roleId));
             SysRole role = selectRoleById(roleId);
-            if (countUserRoleByRoleId(roleId) > 0)
+            if (countUserRoleNotDelByRoleId(roleId) > 0)
             {
                 throw new CustomException(String.format("%1$s已分配,不能删除", role.getRoleName()));
             }

+ 23 - 18
carbon-back/carbon-back-service/src/main/resources/system/SysRoleMapper.xml

@@ -20,16 +20,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 		<result property="updateTime"         column="update_time"           />
 		<result property="remark"             column="remark"                />
 	</resultMap>
-	
+
 	<sql id="selectRoleVo">
 	    select distinct r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.menu_check_strictly, r.dept_check_strictly,
-            r.status, r.del_flag, r.create_time, r.remark 
+            r.status, r.del_flag, r.create_time, r.remark
         from sys_role r
 	        left join sys_user_role ur on ur.role_id = r.role_id
 	        left join sys_user u on u.user_id = ur.user_id
 	        left join sys_dept d on u.dept_id = d.dept_id
     </sql>
-    
+
     <select id="selectRoleList" parameterType="SysRole" resultMap="SysRoleResult">
 		<include refid="selectRoleVo"/>
 		where r.del_flag = '0'
@@ -52,16 +52,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 		${params.dataScope}
 		order by r.role_sort
 	</select>
-    
+
 	<select id="selectRolePermissionByUserId" parameterType="Long" resultMap="SysRoleResult">
 		<include refid="selectRoleVo"/>
 		WHERE r.del_flag = '0' and ur.user_id = #{userId}
 	</select>
-	
+
 	<select id="selectRoleAll" resultMap="SysRoleResult">
 		<include refid="selectRoleVo"/>
 	</select>
-	
+
 	<select id="selectRoleListByUserId" parameterType="Long" resultType="Integer">
 		select r.role_id
         from sys_role r
@@ -69,27 +69,32 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 	        left join sys_user u on u.user_id = ur.user_id
 	    where u.user_id = #{userId}
 	</select>
-	
+
 	<select id="selectRoleById" parameterType="Long" resultMap="SysRoleResult">
 		<include refid="selectRoleVo"/>
 		where r.role_id = #{roleId}
 	</select>
-	
+
+	<select id="checkRoleById" parameterType="Long" resultMap="SysRoleResult">
+		<include refid="selectRoleVo"/>
+		where r.role_id = #{roleId} and u.del_flag=0
+	</select>
+
 	<select id="selectRolesByUserName" parameterType="String" resultMap="SysRoleResult">
 		<include refid="selectRoleVo"/>
 		WHERE r.del_flag = '0' and u.user_name = #{userName}
 	</select>
-	
+
 	<select id="checkRoleNameUnique" parameterType="String" resultMap="SysRoleResult">
 		<include refid="selectRoleVo"/>
 		 where r.role_name=#{roleName} limit 1
 	</select>
-	
+
 	<select id="checkRoleKeyUnique" parameterType="String" resultMap="SysRoleResult">
 		<include refid="selectRoleVo"/>
 		 where r.role_key=#{roleKey} limit 1
 	</select>
-	
+
  	<insert id="insertRole" parameterType="SysRole" useGeneratedKeys="true" keyProperty="roleId">
  		insert into sys_role(
  			<if test="roleId != null and roleId != 0">role_id,</if>
@@ -117,7 +122,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  			sysdate()
  		)
 	</insert>
-	
+
 	<update id="updateRole" parameterType="SysRole">
  		update sys_role
  		<set>
@@ -134,20 +139,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  		</set>
  		where role_id = #{roleId}
 	</update>
-	
+
 	<update id="updateRoleStatus" parameterType="SysRole">
  		update sys_user set status = #{status} where user_id = #{userId}
 	</update>
-	
+
 	<delete id="deleteRoleById" parameterType="Long">
  		delete from sys_role where role_id = #{roleId}
  	</delete>
- 	
+
  	<delete id="deleteRoleByIds" parameterType="Long">
  	    update sys_role set del_flag = '2' where role_id in
  		<foreach collection="array" item="roleId" open="(" separator="," close=")">
  			#{roleId}
-        </foreach> 
+        </foreach>
  	</delete>
- 	
-</mapper> 
+
+</mapper>

+ 13 - 9
carbon-back/carbon-back-service/src/main/resources/system/SysUserRoleMapper.xml

@@ -12,33 +12,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 	<delete id="deleteUserRoleByUserId" parameterType="Long">
 		delete from sys_user_role where user_id=#{userId}
 	</delete>
-	
+
 	<select id="countUserRoleByRoleId" resultType="Integer">
-	    select count(1) from sys_user_role where role_id=#{roleId}  
+	    select count(1) from sys_user_role where role_id=#{roleId}
+	</select>
+
+	<select id="countUserRoleNotDelByRoleId" resultType="Integer">
+	   select count(1) from sys_user_role s LEFT JOIN sys_user u  on s.user_id = u.user_id where s.role_id=#{roleId}  and u.del_flag=0
 	</select>
-	
+
 	<delete id="deleteUserRole" parameterType="Long">
  		delete from sys_user_role where user_id in
  		<foreach collection="array" item="userId" open="(" separator="," close=")">
  			#{userId}
-        </foreach> 
+        </foreach>
  	</delete>
-	
+
 	<insert id="batchUserRole">
 		insert into sys_user_role(user_id, role_id) values
 		<foreach item="item" index="index" collection="list" separator=",">
 			(#{item.userId},#{item.roleId})
 		</foreach>
 	</insert>
-	
+
 	<delete id="deleteUserRoleInfo" parameterType="SysUserRole">
 		delete from sys_user_role where user_id=#{userId} and role_id=#{roleId}
 	</delete>
-	
+
 	<delete id="deleteUserRoleInfos">
 	    delete from sys_user_role where role_id=#{roleId} and user_id in
  	    <foreach collection="userIds" item="userId" open="(" separator="," close=")">
  	        #{userId}
-            </foreach> 
+            </foreach>
 	</delete>
-</mapper> 
+</mapper>

+ 3 - 0
carbon-bank/carbon-bank-service/src/main/java/com/hcloud/microserver/system/bank/controller/MakeClearingController.java

@@ -3,6 +3,7 @@ package com.hcloud.microserver.system.bank.controller;
 import com.github.pagehelper.PageInfo;
 import com.hcloud.microserver.commoncore.base.BaseController;
 import com.hcloud.microserver.commoncore.base.ResponseBase;
+import com.hcloud.microserver.security.annotation.PreAuthorize;
 import com.hcloud.microserver.system.bank.carbon.entity.MakeClearingEntity;
 import com.hcloud.microserver.system.bank.carbon.form.MakeClearForm;
 import com.hcloud.microserver.system.bank.carbon.form.RequestTransferForm;
@@ -39,6 +40,7 @@ public class MakeClearingController extends BaseController {
     }
 
     @ApiOperation("生成清分订单信息")
+    @PreAuthorize(hasPermi = "bankCheck:farmer:create")
     @PostMapping("create")
     public ResponseBase<List<MakeClearingEntity>> create(@RequestBody MakeClearForm form){
         int i = makeClearingService.makeTransfer(form);
@@ -50,6 +52,7 @@ public class MakeClearingController extends BaseController {
 
 
     @ApiOperation("清分")
+    @PreAuthorize(hasPermi = "bankCheck:bank:create")
     @PostMapping("clearing")
     public ResponseBase create(@RequestBody RequestTransferForm form){
         int i = makeClearingService.Clearing(form);

+ 7 - 7
carbon-gateway/src/main/java/com/hcloud/microserver/gateway/filter/AuthGlobalFilter.java

@@ -4,7 +4,9 @@ package com.hcloud.microserver.gateway.filter;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
+import com.hcloud.microserver.api.domain.LoginUser;
 import com.hcloud.microserver.api.domain.R;
+import com.hcloud.microserver.api.domain.SysUser;
 import com.hcloud.microserver.commoncore.base.ResultCode;
 import com.hcloud.microserver.commoncore.constant.CacheConstants;
 import com.hcloud.microserver.commoncore.exception.ApiException;
@@ -25,6 +27,7 @@ import org.springframework.http.HttpStatus;
 import org.springframework.http.MediaType;
 import org.springframework.http.server.reactive.ServerHttpRequest;
 import org.springframework.http.server.reactive.ServerHttpResponse;
+import org.springframework.security.core.token.TokenService;
 import org.springframework.stereotype.Component;
 import org.springframework.util.AntPathMatcher;
 import org.springframework.util.PathMatcher;
@@ -98,18 +101,15 @@ public class AuthGlobalFilter implements GlobalFilter, Ordered {
 
         String s = stringRedisTemplate.opsForValue().get(CacheConstants.LOGIN_USER_INFO + username);
         if (StringUtils.isNotEmpty(s)){
+            Object parse = JSONObject.parse(s);
+            SysUser user1 = JSON.parseObject(parse.toString(), SysUser.class);
+
 
-            JSONArray array = (JSONArray)JSONArray.parse(s);
-            log.info("获取到了登录信息"+array);
-            JSONObject o = (JSONObject)array.get(1);
-            if (o.containsKey("userId")){
-                String userId = o.get("userId").toString();
                 redisTemplate.expire(CacheConstants.LOGIN_USER_INFO + username,EXPIRE_TIME, TimeUnit.SECONDS);
-                ServerHttpRequest mutableReq = exchange.getRequest().mutate().header(CacheConstants.DETAILS_USER_ID, userId)
+                ServerHttpRequest mutableReq = exchange.getRequest().mutate().header(CacheConstants.DETAILS_USER_ID, user1.getUserId()+"")
                         .header(CacheConstants.DETAILS_USERNAME, username).build();
                 ServerWebExchange mutableExchange = exchange.mutate().request(mutableReq).build();
                 return chain.filter(mutableExchange);
-            }
         }
 //        String replace = resultToken.replace("\"", "").trim();
 //        if (!replace.equals(token.trim())){

+ 13 - 10
carbon-security/src/main/java/com/hcloud/microserver/security/service/TokenService.java

@@ -1,5 +1,6 @@
 package com.hcloud.microserver.security.service;
 
+import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.hcloud.microserver.commoncore.constant.CacheConstants;
 import com.hcloud.microserver.api.domain.LoginUser;
@@ -22,7 +23,7 @@ import java.util.concurrent.TimeUnit;
 
 /**
  * token验证处理
- * 
+ *
  * @author ruoyi
  */
 @Component
@@ -90,7 +91,7 @@ public class TokenService
         map.put("expires_in", EXPIRE_TIME);
 //        redisService.setCacheObject(ACCESS_TOKEN + token, userDetails, EXPIRE_TIME, TimeUnit.SECONDS);
 
-        JSONObject jsonObject = (JSONObject)JSONObject.toJSON(userDetails);
+        String jsonObject = JSONObject.toJSONString(userDetails);
         redisService.set(ACCESS_TOKEN + token, jsonObject, EXPIRE_TIME);
 
         return map;
@@ -119,16 +120,18 @@ public class TokenService
         if (StringUtils.isNotEmpty(token))
         {
             String userKey = getTokenKey(token);
-            JSONObject ob = (JSONObject)redisService.get(userKey);
+            Object ob = redisService.get(userKey);
             if (ob == null){
                 return null;
             }
-            if (ob.containsKey("loginUser")){
-                JSONObject jsonObject = (JSONObject)ob.get("loginUser");
-                LoginUser loginUser = JSONObject.toJavaObject(jsonObject, LoginUser.class);
-                return loginUser;
-
-            }
+            LoginUserDetails loginUser = JSON.parseObject(ob.toString(), LoginUserDetails.class);
+            return loginUser.getLoginUser();
+//            if (ob.containsKey("loginUser")){
+//                JSONObject jsonObject = (JSONObject)ob.get("loginUser");
+//                LoginUser loginUser = JSONObject.toJavaObject(jsonObject, LoginUser.class);
+//                return loginUser;
+//
+//            }
         }
         return null;
     }
@@ -200,4 +203,4 @@ public class TokenService
         }
         return token;
     }
-}
+}

+ 2 - 2
common-core/src/main/java/com/hcloud/microserver/commoncore/constant/CacheConstants.java

@@ -2,7 +2,7 @@ package com.hcloud.microserver.commoncore.constant;
 
 /**
  * 缓存的key 常量
- * 
+ *
  * @author ruoyi
  */
 public class CacheConstants
@@ -33,5 +33,5 @@ public class CacheConstants
     public static final String DETAILS_USERNAME = "username";
 
 
-    public static final String LOGIN_USER_INFO="login:user:info";
+    public static final String LOGIN_USER_INFO="login:user:info:";
 }

+ 3 - 1
common-core/src/main/java/com/hcloud/microserver/commoncore/redis/RedisConfig.java

@@ -9,11 +9,12 @@ import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.data.redis.connection.RedisConnectionFactory;
 import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.data.redis.serializer.JdkSerializationRedisSerializer;
 import org.springframework.data.redis.serializer.StringRedisSerializer;
 
 /**
  * redis配置
- * 
+ *
  * @author ruoyi
  */
 @Configuration
@@ -35,6 +36,7 @@ public class RedisConfig extends CachingConfigurerSupport
         serializer.setObjectMapper(mapper);
 
         template.setValueSerializer(serializer);
+//        template.setValueSerializer(new JdkSerializationRedisSerializer());
         // 使用StringRedisSerializer来序列化和反序列化redis的key值
         template.setKeySerializer(new StringRedisSerializer());
         template.afterPropertiesSet();

BIN
doc/carbon-platform/数据库修改.xlsx