Commit 5c8b824d by huluobin

update

parent 9a2a5caa
...@@ -22,7 +22,6 @@ import com.gogirl.infrastructure.common.exception.RRException; ...@@ -22,7 +22,6 @@ import com.gogirl.infrastructure.common.exception.RRException;
import com.gogirl.infrastructure.common.util.ListUtil; import com.gogirl.infrastructure.common.util.ListUtil;
import com.gogirl.infrastructure.common.util.SessionUtils; import com.gogirl.infrastructure.common.util.SessionUtils;
import com.gogirl.infrastructure.common.util.lock.ScheduledLock; import com.gogirl.infrastructure.common.util.lock.ScheduledLock;
import com.gogirl.infrastructure.common.util.lock.TechnicianIdLock;
import com.gogirl.infrastructure.mapper.product.purchase.PurchaseSkuMapper; import com.gogirl.infrastructure.mapper.product.purchase.PurchaseSkuMapper;
import com.gogirl.infrastructure.mapper.product.serve.BaseProduceMapper; import com.gogirl.infrastructure.mapper.product.serve.BaseProduceMapper;
import com.gogirl.shared.order.*; import com.gogirl.shared.order.*;
...@@ -40,7 +39,6 @@ import org.springframework.web.bind.annotation.*; ...@@ -40,7 +39,6 @@ import org.springframework.web.bind.annotation.*;
import java.security.InvalidParameterException; import java.security.InvalidParameterException;
import java.text.ParseException; import java.text.ParseException;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Optional; import java.util.Optional;
...@@ -77,18 +75,18 @@ public class ScheduleManageController { ...@@ -77,18 +75,18 @@ public class ScheduleManageController {
@PostMapping("/customer/schedule/submitSchedule") @PostMapping("/customer/schedule/submitSchedule")
public JsonResult<Void> submitSchedule(@RequestBody SubmitScheduleCommand cmd) throws ParseException, ExecutionException, InterruptedException { public JsonResult<Void> submitSchedule(@RequestBody SubmitScheduleCommand cmd) throws ParseException, ExecutionException, InterruptedException {
Integer customerId = SessionUtils.getCustomerId(); Integer customerId = SessionUtils.getCustomerId();
Map<Integer, TechnicianIdLock> map = new HashMap<>(); // Map<Integer, TechnicianIdLock> map = new HashMap<>();
try { try {
cmd.getDefaultNodeList().forEach(node -> { // cmd.getDefaultNodeList().forEach(node -> {
TechnicianIdLock lock = TechnicianIdLock.getInstance(); // TechnicianIdLock lock = TechnicianIdLock.getInstance();
lock.lock(node.getStoreTechnicianDTO().getTechnicianId()); // lock.lock(node.getStoreTechnicianDTO().getTechnicianId());
map.put(node.getStoreTechnicianDTO().getTechnicianId(), lock); // map.put(node.getStoreTechnicianDTO().getTechnicianId(), lock);
}); // });
cmd.getScheduleManageDTO().setScheduledUser(customerId); cmd.getScheduleManageDTO().setScheduledUser(customerId);
scheduleManageService.submitSchedule(cmd); scheduleManageService.submitSchedule(cmd);
} finally { } finally {
map.forEach((key, lock) -> lock.unlock(key)); // map.forEach((key, lock) -> lock.unlock(key));
} }
return JsonResult.success(); return JsonResult.success();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment