Explorar o código

修改快递单号

yumeng %!s(int64=2) %!d(string=hai) anos
pai
achega
3640b4eb11

+ 31 - 0
ruixuan-live/src/main/java/com/ruixuan/isc/controller/KuaishouItemCollectSamplesController.java

@@ -307,6 +307,37 @@ public class KuaishouItemCollectSamplesController extends BaseController {
     }
 
 
+    @GetMapping("/updateCourierNumber")
+    public JSONObject updateCourierNumber(Long id, String courierNumber, String companyCode) {
+        JSONObject returnJson = new JSONObject();
+        try {
+            if (Check.isNull(id)) {
+                throw new Exception("id不能为空");
+            }
+            if (Check.isNull(courierNumber)) {
+                throw new Exception("快递单号不能为空");
+            }
+            if (Check.isNull(companyCode)) {
+                throw new Exception("公司编号不能为空");
+            }
+            KuaishouItemCollectSamples kuaishouItemCollectSamples = new KuaishouItemCollectSamples();
+            kuaishouItemCollectSamples.setId(id);
+            kuaishouItemCollectSamples.setCourierNumber(courierNumber);
+            int i = kuaishouItemCollectSamplesService.updateKuaishouItemCollectSamples(kuaishouItemCollectSamples);
+            if (i > 0) {
+                kuaishouItemCollectSamplesService.subscribe(id, courierNumber, companyCode);
+            }
+            returnJson.put("code", 0);
+            returnJson.put("message", "修改成功");
+        } catch (Exception e) {
+            e.printStackTrace();
+            returnJson.put("code", 500);
+            returnJson.put("message", e.getMessage());
+        }
+        return returnJson;
+    }
+
+
     @GetMapping("/detail")
     public JSONObject detail(Long id) {
         JSONObject returnJson = new JSONObject();