Inclusion Criteria:  Histopathologically confirmed gastric adenocarcinoma (G) or gastroesophageal junction adenocarcinoma (GEJ, excluding Siewert type I). The clinical stage of the enrolled patients was cT3-4aN+M0 or cT4bNanyM0. Patients with a CY1 status but no other distant metastasis were allowed for patient recruitment. The clinical stage of CY1 patients is cT3-4aN+M1 (CY1 only) or cT4bNanyM1 (CY1 only) (the 8th AJCC staging system of GC). The tumor was considered to be potentially resectable, which was verified by a multidisciplinary team including a surgical investigator. At least one evaluable lesion on abdominal CT/MRI according to the RESIST 1.1 protocol is required. An ECOG (Eastern Cooperative Oncology Group) performance status of 0-1. The patient's physical state and organ function can tolerate the planned treatment of the study protocol, including perioperative chemotherapy with the SOX regimen and immunotherapy with PD-1 monoclonal antibody, preoperative concurrent chemoradiotherapy (45 Gy/25 fractions/S-1), and major abdominal surgery.  The baseline laboratory examinations of the patients met the following criteria:  An adequate hematological function: an absolute neutrophil count (ANC) ≥ 1.5×109/L; a platelet count ≥ 100×109/L; a hemoglobin level ≥ 90 g/L. Adequate liver function: total bilirubin ≤ 1.5×upper limit of normal (ULN); AST/ALT < 2.5×ULN; ALP ≤ 2.5×ULN; ALB ≥ 30 g/L. Adequate renal function: serum creatinine ≤ 1.5 × ULN; creatinine clearance rate ≥ 60 ml/min. Adequate coagulation function: INR/PT ≤ 1.5×ULN; APTT ≤ 1.5×ULN. There was no serious concomitant disease, and the patient's life expectancy was more than 6 months. Male or female. Age ≥ 18 years and ≤ 75 years. Patients agreed to sign a written informed consent before recruitment. Patients had good compliance with the study procedures, including laboratory examinations, auxiliary examinations and treatment. The female patients should not be pregnant or breastfeeding. The female patients agreed to take contraceptive measures during the treatment and within 120 days after the last dose of PD-1 mAb or 180 days after the last dose of chemotherapy or radiotherapy.  Exclusion Criteria:  Clinical or histopathological evidence of peritoneal seeding (P1) or distant metastasis (M1). Patients who have previously received surgery, chemotherapy, radiotherapy or immunotherapy for gastric cancer. Patients had a history of cancer in the five years before randomization except for squamous or basal cell carcinoma of the skin that had been effectively treated and superficial bladder cancer, cervical carcinoma in situ and breast cancer in situ that had been treated by surgery. Pregnant or lactating females or planning to become pregnant or lactating. History of allergy to any drugs involved in this study. History of allogeneic stem cell transplantation or organ transplantation. Vaccinated with a live vaccine within 4 weeks before recruitment. History of anti-PD-1, PD-L1, PD-L2 or any other specific T cell costimulation or checkpoint pathway targeted therapy. History of using steroids (dose > 10 mg/d prednisone) or other systemic immunosuppressive therapy within 14 days before recruitment, except for patients treated with the following regimen: steroids used for hormone replacement (dose > 10 mg/d prednisone); local application of steroids with little systemic absorption; short-term (≤ 7 days) use of steroids to prevent allergy or vomiting. Patients with weight loss of more than 20% within 2 months before recruitment. Uncontrolled systemic diseases, including diabetes and hypertension. Failure of important organs (heart, lung, liver, kidney, etc.). Moderate or severe renal injury [creatinine clearance ≤ 50 ml/min (according to Cockroft & Gault equation)] or SCR > ULN. Dipyrimidine dehydrogenase (DPD) deficiency. Patients with central nervous system (CNS) disorders, peripheral nervous system disorders or psychiatric diseases. A cerebrovascular accident that occurred within 6 months before recruitment. Patients with a known history of uncontrolled or symptomatic angina, uncontrolled arrhythmias and hypertension, congestive heart failure, cardiac infarction within 6 months prior to study recruitment, or cardiac insufficiency. Patients who have the following history of pulmonary diseases: interstitial lung disease, noninfectious pneumonia, pulmonary fibrosis, acute lung disease, or pulmonary embolism. Patients with severe gastrointestinal bleeding, gastrointestinal perforation, or gastrointestinal fistula and patients who cannot swallow to take the drug orally. Patients with upper gastrointestinal obstruction, dysfunction or malabsorption syndrome that can affect the absorption of oral chemotherapy drugs. Uncontrollable pleural effusion, pericardial effusion, or ascites that occurred within two weeks before recruitment. Patients with a history of active autoimmune disease or refractory autoimmune disease. Severe chronic or active infections requiring systemic antibiotics, antifungal or antiviral therapy, including tuberculosis and AIDS. Known history of human immunodeficiency virus (HIV) infection. Patients with untreated chronic hepatitis B or HBV-DNA exceeding 500 IU/ml or HCV-RNA positivity.