|
|
|
@ -1,9 +1,8 @@
|
|
|
|
|
package com.hw.jindie.controller;
|
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson2.JSONObject;
|
|
|
|
|
import com.hw.common.core.domain.R;
|
|
|
|
|
import com.hw.common.core.web.domain.AjaxResult;
|
|
|
|
|
import com.hw.common.log.annotation.Log;
|
|
|
|
|
import com.hw.common.log.enums.BusinessType;
|
|
|
|
|
import com.hw.common.security.annotation.InnerAuth;
|
|
|
|
|
import com.hw.jindie.api.domain.vo.ErpSyncInfoVo;
|
|
|
|
|
import com.hw.jindie.service.IKingdeeErpSyncService;
|
|
|
|
@ -53,12 +52,12 @@ public class KingdeeErpSyncController {
|
|
|
|
|
@PostMapping("/syncUnitInfoFromErp")
|
|
|
|
|
// @Log(title = "ERP单位信息", businessType = BusinessType.INSERT)
|
|
|
|
|
// @InnerAuth
|
|
|
|
|
public AjaxResult syncUnitInfoFromErp(@RequestBody ErpSyncInfoVo erpSyncInfoVo) {
|
|
|
|
|
public R<AjaxResult> syncUnitInfoFromErp(@RequestBody ErpSyncInfoVo erpSyncInfoVo) {
|
|
|
|
|
try {
|
|
|
|
|
return AjaxResult.success(kingdeeErpSyncService.syncUnitInfoFromErp(0, erpSyncInfoVo));
|
|
|
|
|
return R.ok(AjaxResult.success(kingdeeErpSyncService.syncUnitInfoFromErp(0, erpSyncInfoVo)));
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
logger.error("同步单位信息错误:" + e.getMessage());
|
|
|
|
|
return AjaxResult.error(e.getMessage());
|
|
|
|
|
return R.ok(AjaxResult.error(e.getMessage()));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -68,12 +67,12 @@ public class KingdeeErpSyncController {
|
|
|
|
|
@PostMapping("/syncSupplierInfoFromErp")
|
|
|
|
|
// @Log(title = "ERP供应商信息", businessType = BusinessType.INSERT)
|
|
|
|
|
@InnerAuth
|
|
|
|
|
public AjaxResult syncSupplierInfoFromErp(@RequestBody ErpSyncInfoVo erpSyncInfoVo) {
|
|
|
|
|
public R<AjaxResult> syncSupplierInfoFromErp(@RequestBody ErpSyncInfoVo erpSyncInfoVo) {
|
|
|
|
|
try {
|
|
|
|
|
return AjaxResult.success(kingdeeErpSyncService.syncSupplierInfoFromErp(0, erpSyncInfoVo));
|
|
|
|
|
return R.ok(AjaxResult.success(kingdeeErpSyncService.syncSupplierInfoFromErp(0, erpSyncInfoVo)));
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
logger.error("同步供应商信息错误:" + e.getMessage());
|
|
|
|
|
return AjaxResult.error(e.getMessage());
|
|
|
|
|
return R.ok(AjaxResult.error(e.getMessage()));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -83,12 +82,12 @@ public class KingdeeErpSyncController {
|
|
|
|
|
// @Log(title = "ERP物料信息", businessType = BusinessType.INSERT)
|
|
|
|
|
@PostMapping(("/syncMaterialInfoFromErp"))
|
|
|
|
|
// @InnerAuth
|
|
|
|
|
public AjaxResult syncMaterialInfoFromErp(@RequestBody ErpSyncInfoVo erpSyncInfoVo) {
|
|
|
|
|
public R<AjaxResult> syncMaterialInfoFromErp(@RequestBody ErpSyncInfoVo erpSyncInfoVo) {
|
|
|
|
|
try {
|
|
|
|
|
return AjaxResult.success(kingdeeErpSyncService.syncMaterialInfoFromErp(0, erpSyncInfoVo));
|
|
|
|
|
return R.ok(AjaxResult.success(kingdeeErpSyncService.syncMaterialInfoFromErp(0, erpSyncInfoVo)));
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
logger.error("同步物料信息错误:" + e.getMessage());
|
|
|
|
|
return AjaxResult.error(e.getMessage());
|
|
|
|
|
return R.ok(AjaxResult.error(e.getMessage()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
@ -100,12 +99,12 @@ public class KingdeeErpSyncController {
|
|
|
|
|
@PostMapping("/syncProjectInfoFromErp")
|
|
|
|
|
// @Log(title = "ERP项目信息", businessType = BusinessType.INSERT)
|
|
|
|
|
@InnerAuth
|
|
|
|
|
public AjaxResult syncProjectInfoFromErp(@RequestBody ErpSyncInfoVo erpSyncInfoVo) {
|
|
|
|
|
public R<AjaxResult> syncProjectInfoFromErp(@RequestBody ErpSyncInfoVo erpSyncInfoVo) {
|
|
|
|
|
try {
|
|
|
|
|
return AjaxResult.success(kingdeeErpSyncService.syncProjectInfoFromErp(0, erpSyncInfoVo));
|
|
|
|
|
return R.ok(AjaxResult.success(kingdeeErpSyncService.syncProjectInfoFromErp(0, erpSyncInfoVo)));
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
logger.error("同步项目信息错误:" + e.getMessage());
|
|
|
|
|
return AjaxResult.error(e.getMessage());
|
|
|
|
|
return R.ok(AjaxResult.error(e.getMessage()));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -115,12 +114,12 @@ public class KingdeeErpSyncController {
|
|
|
|
|
@PostMapping("/syncSaleOrderFromErp")
|
|
|
|
|
// @Log(title = "ERP销售订单", businessType = BusinessType.INSERT)
|
|
|
|
|
// @InnerAuth
|
|
|
|
|
public AjaxResult syncSaleOrderFromErp(@RequestBody ErpSyncInfoVo erpSyncInfoVo) {
|
|
|
|
|
public R<AjaxResult> syncSaleOrderFromErp(@RequestBody ErpSyncInfoVo erpSyncInfoVo) {
|
|
|
|
|
try {
|
|
|
|
|
return AjaxResult.success(kingdeeErpSyncService.syncSaleOrderFromErp(0, erpSyncInfoVo));
|
|
|
|
|
return R.ok(AjaxResult.success(kingdeeErpSyncService.syncSaleOrderFromErp(0, erpSyncInfoVo)));
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
logger.error("同步销售订单信息错误:" + e.getMessage());
|
|
|
|
|
return AjaxResult.error(e.getMessage());
|
|
|
|
|
return R.ok(AjaxResult.error(e.getMessage()));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -131,27 +130,27 @@ public class KingdeeErpSyncController {
|
|
|
|
|
@PostMapping("/syncPurchaseOrderFromErp")
|
|
|
|
|
// @Log(title = "ERP采购订单", businessType = BusinessType.INSERT)
|
|
|
|
|
@InnerAuth
|
|
|
|
|
public AjaxResult syncPurchaseOrderFromErp(@RequestBody ErpSyncInfoVo erpSyncInfoVo) {
|
|
|
|
|
public R<AjaxResult> syncPurchaseOrderFromErp(@RequestBody ErpSyncInfoVo erpSyncInfoVo) {
|
|
|
|
|
try {
|
|
|
|
|
return AjaxResult.success(kingdeeErpSyncService.syncPurchaseOrderFromErp(0, erpSyncInfoVo));
|
|
|
|
|
return R.ok(AjaxResult.success(kingdeeErpSyncService.syncPurchaseOrderFromErp(0, erpSyncInfoVo)));
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
logger.error("同步采购订单信息错误:" + e.getMessage());
|
|
|
|
|
return AjaxResult.error(e.getMessage());
|
|
|
|
|
return R.ok(AjaxResult.error(e.getMessage()));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 从ERP中同步采购订单信息到MES
|
|
|
|
|
* 从ERP中同步收料通知单到MES
|
|
|
|
|
*/
|
|
|
|
|
@PostMapping("/syncPurchaseReceiveBillFromErp")
|
|
|
|
|
// @Log(title = "ERP采购收料单", businessType = BusinessType.INSERT)
|
|
|
|
|
// @InnerAuth
|
|
|
|
|
public AjaxResult syncPurchaseReceiveBillFromErp(@RequestBody ErpSyncInfoVo erpSyncInfoVo) {
|
|
|
|
|
public R<AjaxResult> syncPurchaseReceiveBillFromErp(@RequestBody ErpSyncInfoVo erpSyncInfoVo) {
|
|
|
|
|
try {
|
|
|
|
|
return AjaxResult.success(kingdeeErpSyncService.syncPurchaseReceiveBillFromErp(0, erpSyncInfoVo));
|
|
|
|
|
return R.ok(AjaxResult.success(kingdeeErpSyncService.syncPurchaseReceiveBillFromErp(0, erpSyncInfoVo)));
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
logger.error("同步采购收料单信息错误:" + e.getMessage());
|
|
|
|
|
return AjaxResult.error(e.getMessage());
|
|
|
|
|
return R.ok(AjaxResult.error(e.getMessage()));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -165,11 +164,11 @@ public class KingdeeErpSyncController {
|
|
|
|
|
@PostMapping(("/singleSavePurchaseRequisition"))
|
|
|
|
|
// @Log(title = "ERP采购申请单", businessType = BusinessType.INSERT)
|
|
|
|
|
@InnerAuth
|
|
|
|
|
public AjaxResult singleSavePurchaseRequisition(@RequestBody String params) {
|
|
|
|
|
public R<AjaxResult> singleSavePurchaseRequisition(@RequestBody String params) {
|
|
|
|
|
try {
|
|
|
|
|
return AjaxResult.success(kingdeeErpService.singleSavePurchaseRequisition(params));
|
|
|
|
|
return R.ok(AjaxResult.success(kingdeeErpService.singleSavePurchaseRequisition(params)));
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
return AjaxResult.error(e.toString());
|
|
|
|
|
return R.ok(AjaxResult.error(e.toString()));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -183,11 +182,11 @@ public class KingdeeErpSyncController {
|
|
|
|
|
* }
|
|
|
|
|
*/
|
|
|
|
|
@PostMapping(("/savePurchaseStorage"))
|
|
|
|
|
public AjaxResult savePurchaseStorage(@RequestBody String params) {
|
|
|
|
|
public R<AjaxResult> savePurchaseStorage(@RequestBody String params) {
|
|
|
|
|
try {
|
|
|
|
|
return AjaxResult.success(kingdeeErpService.savePurchaseStorage(params));
|
|
|
|
|
return R.ok(AjaxResult.success(kingdeeErpService.savePurchaseStorage(params)));
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
return AjaxResult.error(e.toString());
|
|
|
|
|
return R.ok(AjaxResult.error(e.toString()));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -198,11 +197,11 @@ public class KingdeeErpSyncController {
|
|
|
|
|
* @return {"msg": "{\"IsSuccess\":true,\"Errors\":[],\"SuccessEntitys\":[{\"Id\":\"116470\",\"Number\":\"QTCK004153\",\"DIndex\":0}]}","code": 200}
|
|
|
|
|
*/
|
|
|
|
|
@PostMapping(("/saveOtherOutStorage"))
|
|
|
|
|
public AjaxResult saveOtherOutStorage(@RequestBody String params) {
|
|
|
|
|
public R<AjaxResult> saveOtherOutStorage(@RequestBody String params) {
|
|
|
|
|
try {
|
|
|
|
|
return AjaxResult.success(kingdeeErpService.saveOtherOutStorage(params));
|
|
|
|
|
return R.ok(AjaxResult.success(kingdeeErpService.saveOtherOutStorage(params)));
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
return AjaxResult.error(e.toString());
|
|
|
|
|
return R.ok(AjaxResult.error(e.toString()));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -214,11 +213,11 @@ public class KingdeeErpSyncController {
|
|
|
|
|
* @return { "msg": "{\"IsSuccess\":true,\"Errors\":[],\"SuccessEntitys\":[{\"Id\":\"100418\",\"Number\":\"QTRK000352\",\"DIndex\":0}]}", "code": 200}
|
|
|
|
|
*/
|
|
|
|
|
@PostMapping(("/saveOtherInStorage"))
|
|
|
|
|
public AjaxResult saveOtherInStorage(@RequestBody String params) {
|
|
|
|
|
public R<AjaxResult> saveOtherInStorage(@RequestBody String params) {
|
|
|
|
|
try {
|
|
|
|
|
return AjaxResult.success(kingdeeErpService.saveOtherInStorage(params));
|
|
|
|
|
return R.ok(AjaxResult.success(kingdeeErpService.saveOtherInStorage(params)));
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
return AjaxResult.error(e.toString());
|
|
|
|
|
return R.ok(AjaxResult.error(e.toString()));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|