提交 8ee71b6e authored 作者: hzh's avatar hzh

代码优化

上级 c9ec0241
...@@ -102,7 +102,7 @@ public class WeishiController { ...@@ -102,7 +102,7 @@ public class WeishiController {
*/ */
@PostMapping("/insureIssue/{orderNum}") @PostMapping("/insureIssue/{orderNum}")
public R<IssueResponse> insureIssue(@PathVariable String orderNum) { public R<IssueResponse> insureIssue(@PathVariable String orderNum) {
IssueResponse res = weishiService.insureIssue(getToken(), orderNum); IssueResponse res = weishiService.insureIssue(getToken(orderNum), orderNum);
insureService.insureIssue(orderNum); insureService.insureIssue(orderNum);
return R.ok(res); return R.ok(res);
} }
...@@ -115,7 +115,7 @@ public class WeishiController { ...@@ -115,7 +115,7 @@ public class WeishiController {
*/ */
@PostMapping("/insureDetail/{orderId}") @PostMapping("/insureDetail/{orderId}")
public R<DetailResponse> insureDetail(@PathVariable Integer orderId) { public R<DetailResponse> insureDetail(@PathVariable Integer orderId) {
return R.ok(weishiService.insureDetail(getToken(), orderId)); return R.ok(weishiService.insureDetail(getToken(orderId), orderId));
} }
/** /**
...@@ -126,7 +126,7 @@ public class WeishiController { ...@@ -126,7 +126,7 @@ public class WeishiController {
*/ */
@GetMapping("/insureDownload/{orderNum}") @GetMapping("/insureDownload/{orderNum}")
public R<String> insureDownload(@PathVariable String orderNum) { public R<String> insureDownload(@PathVariable String orderNum) {
return R.ok("操作成功", weishiService.insureDownload(getToken(), orderNum)); return R.ok("操作成功", weishiService.insureDownload(getToken(orderNum), orderNum));
} }
...@@ -137,7 +137,7 @@ public class WeishiController { ...@@ -137,7 +137,7 @@ public class WeishiController {
*/ */
@PostMapping("/insureCancel/{orderNum}") @PostMapping("/insureCancel/{orderNum}")
public R<Void> insureCancel(@PathVariable String orderNum) { public R<Void> insureCancel(@PathVariable String orderNum) {
weishiService.insureCancel(getToken(), orderNum); weishiService.insureCancel(getToken(orderNum), orderNum);
insureService.insureCancel(orderNum); insureService.insureCancel(orderNum);
return R.ok(); return R.ok();
} }
...@@ -149,7 +149,7 @@ public class WeishiController { ...@@ -149,7 +149,7 @@ public class WeishiController {
*/ */
@PostMapping("/insureAbandon/{orderId}") @PostMapping("/insureAbandon/{orderId}")
public R<IssueResponse> insureAbandon(@PathVariable Integer orderId) { public R<IssueResponse> insureAbandon(@PathVariable Integer orderId) {
weishiService.insureAbandon(getToken(), orderId); weishiService.insureAbandon(getToken(orderId), orderId);
insureService.insureAbandon(orderId); insureService.insureAbandon(orderId);
return R.ok(); return R.ok();
} }
...@@ -174,8 +174,7 @@ public class WeishiController { ...@@ -174,8 +174,7 @@ public class WeishiController {
*/ */
@GetMapping("/token") @GetMapping("/token")
public R<String> token(@RequestParam Integer orderId) { public R<String> token(@RequestParam Integer orderId) {
InsureVo insure = insureService.getOne(new InsureBo().setOrderId(orderId)); return R.ok("操作成功", getToken(orderId));
return R.ok("操作成功", thirdWeishiService.getToken(insure.getCreateDept()));
} }
...@@ -198,4 +197,15 @@ public class WeishiController { ...@@ -198,4 +197,15 @@ public class WeishiController {
return thirdWeishiService.getToken(LoginHelper.getDeptId()); return thirdWeishiService.getToken(LoginHelper.getDeptId());
} }
private String getToken(Integer orderId) {
InsureVo insure = insureService.getOne(new InsureBo().setOrderId(orderId));
return thirdWeishiService.getToken(insure.getCreateDept());
}
private String getToken(String orderNum) {
InsureVo insure = insureService.getOne(new InsureBo().setOrderNum(orderNum));
return thirdWeishiService.getToken(insure.getCreateDept());
}
} }
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论