master
yixian 4 years ago
parent 639b861495
commit ddd4a4a181

@ -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.manage.permission.manager.scanner.PermissionReader;
import au.com.royalpay.payment.tools.exceptions.BadRequestException; import au.com.royalpay.payment.tools.exceptions.BadRequestException;
import au.com.royalpay.payment.tools.permission.enums.ManagerRole; import au.com.royalpay.payment.tools.permission.enums.ManagerRole;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import org.springframework.cache.annotation.CacheEvict; import org.springframework.cache.annotation.CacheEvict;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; 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 javax.annotation.Resource;
import java.util.*;
/** /**
* Created by yixian on 2017-02-28. * Created by yixian on 2017-02-28.
@ -40,13 +33,13 @@ public class PermissionManagerImpl implements PermissionManager {
List<JSONObject> functions = permissionFunctionMapper.listAll(); List<JSONObject> functions = permissionFunctionMapper.listAll();
Map<String, JSONObject> funcMapFromDB = new HashMap<>(); Map<String, JSONObject> funcMapFromDB = new HashMap<>();
for (JSONObject func : functions) { for (JSONObject func : functions) {
funcMapFromDB.put(func.getString("func_id"), func); funcMapFromDB.put(func.getString("func_id").toLowerCase(), func);
} }
List<PermissionNode> nodes = permissionReader.listFunctions(); List<PermissionNode> nodes = permissionReader.listFunctions();
for (PermissionNode node : nodes) { for (PermissionNode node : nodes) {
String funcId = node.getFuncId(); String funcId = node.getFuncId();
if (funcMapFromDB.containsKey(funcId)) { if (funcMapFromDB.containsKey(funcId.toLowerCase())) {
funcMapFromDB.remove(funcId); funcMapFromDB.remove(funcId);
JSONObject func = node.initFuncObject(); JSONObject func = node.initFuncObject();
func.remove("role"); func.remove("role");

@ -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 { public void uploadEmail(@PathVariable String risk_id) throws IOException {
riskBusinessService.sendUploadEmail(risk_id); 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 { public void refuseEmail(@PathVariable("risk_id") String riskId, @RequestBody JSONObject otherParams) throws IOException {
riskBusinessService.sendRefuseEmail(riskId, otherParams.getString("refuse_description")); riskBusinessService.sendRefuseEmail(riskId, otherParams.getString("refuse_description"));
} }
@GetMapping(value = "/{risk_id}/material") @GetMapping("/{risk_id}/material")
public JSONObject getRiskMaterial(@PathVariable("risk_id") String riskId) { public JSONObject getRiskMaterial(@PathVariable("risk_id") String riskId) {
JSONObject param = new JSONObject(); JSONObject param = new JSONObject();
param.put("risk_id", riskId); param.put("risk_id", riskId);
return riskBusinessService.getRiskMaterial(param); 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) { public JSONObject getRiskAlMaterialInfo(@PathVariable("risk_id") String riskId) {
return riskBusinessService.getRiskEventMaterialsRemark(riskId); return riskBusinessService.getRiskEventMaterialsRemark(riskId);
} }
@PutMapping(value = "/channel/{channel}/permission/{channelFlag}") @PutMapping("/channel/{channel}/permission/{channelFlag}")
public void updateMerchantChannel(@RequestBody JSONObject params, public void updateMerchantChannel(@RequestBody JSONObject params,
@PathVariable("channelFlag") Boolean channelFlag, @PathVariable("channelFlag") Boolean channelFlag,
@PathVariable("channel") String channel, @PathVariable("channel") String channel,
@ -149,7 +149,7 @@ public class RiskBusinessController {
riskBusinessService.updateRiskEvent(params, manager); riskBusinessService.updateRiskEvent(params, manager);
} }
@PutMapping(value = "/partner/{isValid}") @PutMapping("/partner/{isValid}")
public void updateMerchantValid(@RequestBody JSONObject params, public void updateMerchantValid(@RequestBody JSONObject params,
@PathVariable("isValid") Boolean isValid, @PathVariable("isValid") Boolean isValid,
@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
@ -196,28 +196,28 @@ public class RiskBusinessController {
} }
// 更新库中的orderIds // 更新库中的orderIds
@GetMapping(value = "/complete/real_order_id") @GetMapping("/complete/real_order_id")
public void completeEventRealOrderIds() { public void completeEventRealOrderIds() {
riskBusinessService.completeEventRealOrderIds(); riskBusinessService.completeEventRealOrderIds();
} }
@GetMapping(value = "/delete/event") @GetMapping("/delete/event")
public void deleteRiskEvent(@RequestParam("risk_id") String riskId) { public void deleteRiskEvent(@RequestParam("risk_id") String riskId) {
riskBusinessService.deleteRiskEvent(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) { public JSONObject updateRiskEventIsSendClient(@RequestParam("risk_id") String riskId) {
return riskBusinessService.updateIsSendClient(riskId); return riskBusinessService.updateIsSendClient(riskId);
} }
@GetMapping(value = "/complete/event/order_amount") @GetMapping("/complete/event/order_amount")
public String completeOrderAmount() { public String completeOrderAmount() {
riskBusinessService.completeOrderAmount(); riskBusinessService.completeOrderAmount();
return "SUCCESS"; return "SUCCESS";
} }
@PutMapping(value = "{risk_id}/remark") @PutMapping("{risk_id}/remark")
@ResponseBody @ResponseBody
public void updateRiskEventRemark(@PathVariable("risk_id") String riskId, @RequestBody JSONObject remark) { public void updateRiskEventRemark(@PathVariable("risk_id") String riskId, @RequestBody JSONObject remark) {
riskBusinessService.updateRiskEventRemark(riskId, remark.getString("remark")); riskBusinessService.updateRiskEventRemark(riskId, remark.getString("remark"));

Loading…
Cancel
Save