|
|
@@ -4,6 +4,7 @@ import com.alibaba.fastjson2.JSON;
|
|
|
import com.alibaba.fastjson2.JSONArray;
|
|
|
import com.alibaba.fastjson2.JSONObject;
|
|
|
import common.YosLogger;
|
|
|
+import common.crm.bean.core.CrmBase;
|
|
|
import common.crm.bean.icstockbill;
|
|
|
import common.crm.bean.saorder;
|
|
|
import common.crm.bean.sku_crm;
|
|
|
@@ -19,6 +20,9 @@ public class crm_put {
|
|
|
@RequestMapping(value = "/confirmReceiveBill", method = RequestMethod.GET)
|
|
|
@ResponseBody
|
|
|
public String confirmReceiveBill(HttpServletRequest request, HttpServletResponse response, @RequestParam("fagentnum") String fagentnum, @RequestParam("fcrmbillnum") String fcrmbillnum, @RequestParam("icstockbillids") String[] icstockbillids, @RequestParam("token") String token) {
|
|
|
+ if (!CrmBase.crm_sync_switch()) {
|
|
|
+ return getErrResult("crm_sync_switch is false").toString();
|
|
|
+ }
|
|
|
return new icstockbill(YosLogger.logger).confirmReceiveBill(fagentnum, fcrmbillnum, icstockbillids).toString();
|
|
|
}
|
|
|
|
|
|
@@ -26,6 +30,9 @@ public class crm_put {
|
|
|
@PostMapping
|
|
|
@ResponseBody
|
|
|
public String modifyTmachinecodes(HttpServletRequest request, HttpServletResponse response, @RequestBody String body, @RequestParam(value = "token", required = false) String token) {
|
|
|
+ if (!CrmBase.crm_sync_switch()) {
|
|
|
+ return getErrResult("crm_sync_switch is false").toString();
|
|
|
+ }
|
|
|
JSONArray result = new JSONArray();
|
|
|
JSONArray jsonArray = JSON.parseArray(body);
|
|
|
sku_crm skuCrm = new sku_crm(YosLogger.logger);
|
|
|
@@ -43,6 +50,9 @@ public class crm_put {
|
|
|
@PostMapping
|
|
|
@ResponseBody
|
|
|
public String updateDRPWarrantycard(HttpServletRequest request, HttpServletResponse response, @RequestBody String body, @RequestParam(value = "token", required = false) String token) {
|
|
|
+ if (!CrmBase.crm_sync_switch()) {
|
|
|
+ return getErrResult("crm_sync_switch is false").toString();
|
|
|
+ }
|
|
|
return "";
|
|
|
}
|
|
|
|
|
|
@@ -50,18 +60,20 @@ public class crm_put {
|
|
|
@PostMapping
|
|
|
@ResponseBody
|
|
|
public String insertSaorder(HttpServletRequest request, HttpServletResponse response, @RequestBody String body, @RequestParam(value = "token", required = false) String token) {
|
|
|
+ if (!CrmBase.crm_sync_switch()) {
|
|
|
+ return getErrResult("crm_sync_switch is false").toString();
|
|
|
+ }
|
|
|
JSONObject jsonObject = JSON.parseObject(body);
|
|
|
saorder saorder = new saorder(YosLogger.logger);
|
|
|
return saorder.insertSaorder(jsonObject).toJSONString();
|
|
|
}
|
|
|
|
|
|
- public JSONObject getSuccessResult() {
|
|
|
+ public JSONObject getErrResult(String msg) {
|
|
|
JSONObject object = new JSONObject();
|
|
|
- object.put("code", 1);
|
|
|
- object.put("msg", "");
|
|
|
- object.put("data", "");
|
|
|
+ object.put("code", 0);
|
|
|
+ object.put("msg", msg);
|
|
|
+ object.put("data", null);
|
|
|
object.put("uri", "");
|
|
|
return object;
|
|
|
}
|
|
|
-
|
|
|
}
|