From ddd4a4a181fbce5ed15efeee2b5bd84ec2507911 Mon Sep 17 00:00:00 2001 From: yixian Date: Wed, 5 Aug 2020 13:46:21 +1000 Subject: [PATCH 1/2] sync code --- .../core/impls/PermissionManagerImpl.java | 13 +++-------- .../web/RiskBusinessController.java | 22 +++++++++---------- 2 files changed, 14 insertions(+), 21 deletions(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/management/sysconfig/core/impls/PermissionManagerImpl.java b/src/main/java/au/com/royalpay/payment/manage/management/sysconfig/core/impls/PermissionManagerImpl.java index c8b743046..2f75d45cc 100644 --- a/src/main/java/au/com/royalpay/payment/manage/management/sysconfig/core/impls/PermissionManagerImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/management/sysconfig/core/impls/PermissionManagerImpl.java @@ -9,20 +9,13 @@ import au.com.royalpay.payment.manage.permission.manager.scanner.PermissionNode; import au.com.royalpay.payment.manage.permission.manager.scanner.PermissionReader; import au.com.royalpay.payment.tools.exceptions.BadRequestException; import au.com.royalpay.payment.tools.permission.enums.ManagerRole; - import com.alibaba.fastjson.JSONObject; - import org.springframework.cache.annotation.CacheEvict; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.TreeMap; - import javax.annotation.Resource; +import java.util.*; /** * Created by yixian on 2017-02-28. @@ -40,13 +33,13 @@ public class PermissionManagerImpl implements PermissionManager { List functions = permissionFunctionMapper.listAll(); Map funcMapFromDB = new HashMap<>(); for (JSONObject func : functions) { - funcMapFromDB.put(func.getString("func_id"), func); + funcMapFromDB.put(func.getString("func_id").toLowerCase(), func); } List nodes = permissionReader.listFunctions(); for (PermissionNode node : nodes) { String funcId = node.getFuncId(); - if (funcMapFromDB.containsKey(funcId)) { + if (funcMapFromDB.containsKey(funcId.toLowerCase())) { funcMapFromDB.remove(funcId); JSONObject func = node.initFuncObject(); func.remove("role"); diff --git a/src/main/java/au/com/royalpay/payment/manage/riskbusiness/web/RiskBusinessController.java b/src/main/java/au/com/royalpay/payment/manage/riskbusiness/web/RiskBusinessController.java index 9791a534b..de35da3c3 100644 --- a/src/main/java/au/com/royalpay/payment/manage/riskbusiness/web/RiskBusinessController.java +++ b/src/main/java/au/com/royalpay/payment/manage/riskbusiness/web/RiskBusinessController.java @@ -111,29 +111,29 @@ public class RiskBusinessController { } - @RequestMapping(value = "/{risk_id}/upload_mail", method = RequestMethod.PUT) + @PutMapping("/{risk_id}/upload_mail") public void uploadEmail(@PathVariable String risk_id) throws IOException { riskBusinessService.sendUploadEmail(risk_id); } - @RequestMapping(value = "/{risk_id}/refuse", method = RequestMethod.PUT) + @PutMapping("/{risk_id}/refuse") public void refuseEmail(@PathVariable("risk_id") String riskId, @RequestBody JSONObject otherParams) throws IOException { riskBusinessService.sendRefuseEmail(riskId, otherParams.getString("refuse_description")); } - @GetMapping(value = "/{risk_id}/material") + @GetMapping("/{risk_id}/material") public JSONObject getRiskMaterial(@PathVariable("risk_id") String riskId) { JSONObject param = new JSONObject(); param.put("risk_id", riskId); return riskBusinessService.getRiskMaterial(param); } - @GetMapping(value = "/{risk_id}/all_material_info") + @GetMapping("/{risk_id}/all_material_info") public JSONObject getRiskAlMaterialInfo(@PathVariable("risk_id") String riskId) { return riskBusinessService.getRiskEventMaterialsRemark(riskId); } - @PutMapping(value = "/channel/{channel}/permission/{channelFlag}") + @PutMapping("/channel/{channel}/permission/{channelFlag}") public void updateMerchantChannel(@RequestBody JSONObject params, @PathVariable("channelFlag") Boolean channelFlag, @PathVariable("channel") String channel, @@ -149,7 +149,7 @@ public class RiskBusinessController { riskBusinessService.updateRiskEvent(params, manager); } - @PutMapping(value = "/partner/{isValid}") + @PutMapping("/partner/{isValid}") public void updateMerchantValid(@RequestBody JSONObject params, @PathVariable("isValid") Boolean isValid, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { @@ -196,28 +196,28 @@ public class RiskBusinessController { } // 更新库中的orderIds - @GetMapping(value = "/complete/real_order_id") + @GetMapping("/complete/real_order_id") public void completeEventRealOrderIds() { riskBusinessService.completeEventRealOrderIds(); } - @GetMapping(value = "/delete/event") + @GetMapping("/delete/event") public void deleteRiskEvent(@RequestParam("risk_id") String riskId) { riskBusinessService.deleteRiskEvent(riskId); } - @GetMapping(value = "/update/event/is_send_client") + @GetMapping("/update/event/is_send_client") public JSONObject updateRiskEventIsSendClient(@RequestParam("risk_id") String riskId) { return riskBusinessService.updateIsSendClient(riskId); } - @GetMapping(value = "/complete/event/order_amount") + @GetMapping("/complete/event/order_amount") public String completeOrderAmount() { riskBusinessService.completeOrderAmount(); return "SUCCESS"; } - @PutMapping(value = "{risk_id}/remark") + @PutMapping("{risk_id}/remark") @ResponseBody public void updateRiskEventRemark(@PathVariable("risk_id") String riskId, @RequestBody JSONObject remark) { riskBusinessService.updateRiskEventRemark(riskId, remark.getString("remark")); From 2838b74fe18d5bab0d03040b97b6feecf297268c Mon Sep 17 00:00:00 2001 From: yixian Date: Wed, 5 Aug 2020 14:16:35 +1000 Subject: [PATCH 2/2] UI bug fix --- src/main/ui/static/analysis/risk_business.js | 2 +- .../static/analysis/templates/new_riskEvent.html | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/main/ui/static/analysis/risk_business.js b/src/main/ui/static/analysis/risk_business.js index 31c4f86d6..1c33fa8fd 100644 --- a/src/main/ui/static/analysis/risk_business.js +++ b/src/main/ui/static/analysis/risk_business.js @@ -752,7 +752,7 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'], $scope.searchForChargeback = function () { $scope.riskEvent.order_ids = null; let channelOrderId = $scope.riskEvent.channel_order_id; - $http.get('/risk/business/chargeback_orders', {channel_order_id: channelOrderId}).then(function (res) { + $http.get('/risk/business/chargeback_orders', {params: {channel_order_id: channelOrderId}}).then(function (res) { $scope.channel_orders = res.data; }, function (res) { commonDialog.alert({type: 'error', title: 'Error', content: res.data.message}) diff --git a/src/main/ui/static/analysis/templates/new_riskEvent.html b/src/main/ui/static/analysis/templates/new_riskEvent.html index 7ac541a95..15cc552ee 100644 --- a/src/main/ui/static/analysis/templates/new_riskEvent.html +++ b/src/main/ui/static/analysis/templates/new_riskEvent.html @@ -204,6 +204,22 @@ +
+ +
+
+
+
+
+ +
+
+
+