Commit 5c8b824d by huluobin

update

parent 9a2a5caa
......@@ -22,7 +22,6 @@ import com.gogirl.infrastructure.common.exception.RRException;
import com.gogirl.infrastructure.common.util.ListUtil;
import com.gogirl.infrastructure.common.util.SessionUtils;
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.serve.BaseProduceMapper;
import com.gogirl.shared.order.*;
......@@ -40,7 +39,6 @@ import org.springframework.web.bind.annotation.*;
import java.security.InvalidParameterException;
import java.text.ParseException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
......@@ -77,18 +75,18 @@ public class ScheduleManageController {
@PostMapping("/customer/schedule/submitSchedule")
public JsonResult<Void> submitSchedule(@RequestBody SubmitScheduleCommand cmd) throws ParseException, ExecutionException, InterruptedException {
Integer customerId = SessionUtils.getCustomerId();
Map<Integer, TechnicianIdLock> map = new HashMap<>();
// Map<Integer, TechnicianIdLock> map = new HashMap<>();
try {
cmd.getDefaultNodeList().forEach(node -> {
TechnicianIdLock lock = TechnicianIdLock.getInstance();
lock.lock(node.getStoreTechnicianDTO().getTechnicianId());
map.put(node.getStoreTechnicianDTO().getTechnicianId(), lock);
});
// cmd.getDefaultNodeList().forEach(node -> {
// TechnicianIdLock lock = TechnicianIdLock.getInstance();
// lock.lock(node.getStoreTechnicianDTO().getTechnicianId());
// map.put(node.getStoreTechnicianDTO().getTechnicianId(), lock);
// });
cmd.getScheduleManageDTO().setScheduledUser(customerId);
scheduleManageService.submitSchedule(cmd);
} finally {
map.forEach((key, lock) -> lock.unlock(key));
// map.forEach((key, lock) -> lock.unlock(key));
}
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