FengChaoYu пре 6 месеци
родитељ
комит
b2886abb32

+ 11 - 2
mall-server-api/src/main/java/com/gree/mall/manager/controller/workerorder/AppraiseApplyController.java

@@ -152,8 +152,17 @@ public class AppraiseApplyController {
 
     @PostMapping("/apply/confirm")
     @ApiOperation(value = "评价申诉-审核")
-    public ResponseHelper applyConfirm(@RequestBody PgAppraiseApplyBean bean) {
-        appraiseRelaLogic.applyConfirm(bean);
+    public ResponseHelper applyConfirm(@RequestBody PgAppraiseApplyBean bean) throws Exception {
+        Lock obtain = redisLockRegistry.obtain(Constant.RedisPrefix.LOCK_ORDER + bean.getId());
+        if (!obtain.tryLock(10, TimeUnit.SECONDS)) {
+            throw new RemoteServiceException("处理中,请稍后再试");
+        }
+        try {
+            appraiseRelaLogic.applyConfirm(bean);
+        } finally {
+            obtain.unlock();
+        }
+
         return ResponseHelper.success();
     }
 

+ 1 - 0
mall-server-api/src/main/java/com/gree/mall/manager/logic/workorder/AppraiseRelaLogic.java

@@ -375,6 +375,7 @@ public class AppraiseRelaLogic {
             apply.setExamineResult(orderBase.getAppraiseStatus());
         }
 
+        apply.updateById();
         pgOrderBaseService.lambdaUpdate()
                 .set(PgOrderBase::getAppraiseApplyResult, apply.getExamineResult())
                 .eq(PgOrderBase::getId, orderBase.getId())