|
|
@ -5,8 +5,11 @@ import com.hw.common.core.web.domain.AjaxResult;
|
|
|
|
import com.hw.common.log.annotation.Log;
|
|
|
|
import com.hw.common.log.annotation.Log;
|
|
|
|
import com.hw.common.log.enums.BusinessType;
|
|
|
|
import com.hw.common.log.enums.BusinessType;
|
|
|
|
import com.hw.common.security.annotation.InnerAuth;
|
|
|
|
import com.hw.common.security.annotation.InnerAuth;
|
|
|
|
|
|
|
|
import com.hw.jindie.api.domain.vo.ErpSyncInfoVo;
|
|
|
|
import com.hw.jindie.service.IKingdeeErpSyncService;
|
|
|
|
import com.hw.jindie.service.IKingdeeErpSyncService;
|
|
|
|
import com.hw.jindie.service.impl.KingdeeErpService;
|
|
|
|
import com.hw.jindie.service.impl.KingdeeErpService;
|
|
|
|
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
|
|
|
@ -20,6 +23,8 @@ import org.springframework.web.bind.annotation.*;
|
|
|
|
@RestController
|
|
|
|
@RestController
|
|
|
|
@RequestMapping("/jindie")
|
|
|
|
@RequestMapping("/jindie")
|
|
|
|
public class KingdeeErpSyncController {
|
|
|
|
public class KingdeeErpSyncController {
|
|
|
|
|
|
|
|
private static final Logger logger = LoggerFactory.getLogger(KingdeeErpSyncController.class);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
|
private IKingdeeErpSyncService kingdeeErpSyncService;
|
|
|
|
private IKingdeeErpSyncService kingdeeErpSyncService;
|
|
|
@ -29,7 +34,7 @@ public class KingdeeErpSyncController {
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 从erp中同步供应商数据到MES
|
|
|
|
* 从erp中同步供应商数据到MES
|
|
|
|
* */
|
|
|
|
*/
|
|
|
|
@PostMapping("/syncSupplierInfoFromErp")
|
|
|
|
@PostMapping("/syncSupplierInfoFromErp")
|
|
|
|
@Log(title = "ERP供应商信息", businessType = BusinessType.INSERT)
|
|
|
|
@Log(title = "ERP供应商信息", businessType = BusinessType.INSERT)
|
|
|
|
@InnerAuth
|
|
|
|
@InnerAuth
|
|
|
@ -37,7 +42,7 @@ public class KingdeeErpSyncController {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
return AjaxResult.success(kingdeeErpSyncService.syncSupplierInfoFromErp(0));
|
|
|
|
return AjaxResult.success(kingdeeErpSyncService.syncSupplierInfoFromErp(0));
|
|
|
|
} catch (Exception e) {
|
|
|
|
} catch (Exception e) {
|
|
|
|
e.printStackTrace();
|
|
|
|
logger.error("同步供应商信息错误:" + e.getMessage());
|
|
|
|
return AjaxResult.error();
|
|
|
|
return AjaxResult.error();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -45,49 +50,46 @@ public class KingdeeErpSyncController {
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 从ERP中同步物料信息到MES
|
|
|
|
* 从ERP中同步物料信息到MES
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
// @RequiresPermissions("wms:mobile:addrawinstock")
|
|
|
|
|
|
|
|
@Log(title = "ERP物料信息", businessType = BusinessType.INSERT)
|
|
|
|
@Log(title = "ERP物料信息", businessType = BusinessType.INSERT)
|
|
|
|
@PostMapping(("/syncMaterialInfoFromErp"))
|
|
|
|
@PostMapping(("/syncMaterialInfoFromErp"))
|
|
|
|
@InnerAuth
|
|
|
|
@InnerAuth
|
|
|
|
public AjaxResult syncMaterialInfoFromErp() {
|
|
|
|
public AjaxResult syncMaterialInfoFromErp(@RequestBody ErpSyncInfoVo erpSyncInfoVo) {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
return AjaxResult.success(kingdeeErpSyncService.syncMaterialInfoFromErp(0));
|
|
|
|
return AjaxResult.success(kingdeeErpSyncService.syncMaterialInfoFromErp(0, erpSyncInfoVo));
|
|
|
|
} catch (Exception e) {
|
|
|
|
} catch (Exception e) {
|
|
|
|
e.printStackTrace();
|
|
|
|
logger.error("同步物料信息错误:" + e.getMessage());
|
|
|
|
return AjaxResult.error();
|
|
|
|
return AjaxResult.error();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 从ERP中同步项目信息到MES
|
|
|
|
* 从ERP中同步项目信息到MES
|
|
|
|
* */
|
|
|
|
*/
|
|
|
|
@PostMapping("/syncProjectInfoFromErp")
|
|
|
|
@PostMapping("/syncProjectInfoFromErp")
|
|
|
|
@Log(title = "ERP项目信息", businessType = BusinessType.INSERT)
|
|
|
|
@Log(title = "ERP项目信息", businessType = BusinessType.INSERT)
|
|
|
|
@InnerAuth
|
|
|
|
@InnerAuth
|
|
|
|
public AjaxResult syncProjectInfoFromErp() {
|
|
|
|
public AjaxResult syncProjectInfoFromErp() {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
return AjaxResult.success(kingdeeErpSyncService.syncProjectInfoFromErp(0));
|
|
|
|
return AjaxResult.success(kingdeeErpSyncService.syncProjectInfoFromErp(0));
|
|
|
|
}
|
|
|
|
} catch (Exception e) {
|
|
|
|
catch (Exception e) {
|
|
|
|
logger.error("同步项目信息错误:" + e.getMessage());
|
|
|
|
return AjaxResult.error();
|
|
|
|
return AjaxResult.error();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 从ERP中同步销售订单信息到ERP
|
|
|
|
* 从ERP中同步销售订单信息到ERP
|
|
|
|
* */
|
|
|
|
*/
|
|
|
|
@PostMapping("/syncSaleOrderFromErp")
|
|
|
|
@PostMapping("/syncSaleOrderFromErp")
|
|
|
|
@Log(title = "ERP销售订单", businessType = BusinessType.INSERT)
|
|
|
|
@Log(title = "ERP销售订单", businessType = BusinessType.INSERT)
|
|
|
|
@InnerAuth
|
|
|
|
@InnerAuth
|
|
|
|
public AjaxResult syncSaleOrderFromErp() {
|
|
|
|
public AjaxResult syncSaleOrderFromErp() {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
return AjaxResult.success(kingdeeErpSyncService.syncSaleOrderFromErp(0));
|
|
|
|
return AjaxResult.success(kingdeeErpSyncService.syncSaleOrderFromErp(0));
|
|
|
|
}
|
|
|
|
} catch (Exception e) {
|
|
|
|
catch (Exception e) {
|
|
|
|
logger.error("同步销售订单信息错误:" + e.getMessage());
|
|
|
|
e.printStackTrace();
|
|
|
|
|
|
|
|
return AjaxResult.error();
|
|
|
|
return AjaxResult.error();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -95,25 +97,20 @@ public class KingdeeErpSyncController {
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 从ERP中同步采购订单信息到MES
|
|
|
|
* 从ERP中同步采购订单信息到MES
|
|
|
|
* */
|
|
|
|
*/
|
|
|
|
@PostMapping("/syncPurchaseOrderFromErp")
|
|
|
|
@PostMapping("/syncPurchaseOrderFromErp")
|
|
|
|
@Log(title = "ERP采购订单", businessType = BusinessType.INSERT)
|
|
|
|
@Log(title = "ERP采购订单", businessType = BusinessType.INSERT)
|
|
|
|
@InnerAuth
|
|
|
|
@InnerAuth
|
|
|
|
public AjaxResult syncPurchaseOrderFromErp() {
|
|
|
|
public AjaxResult syncPurchaseOrderFromErp() {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
return AjaxResult.success(kingdeeErpSyncService.syncPurchaseOrderFromErp(0));
|
|
|
|
return AjaxResult.success(kingdeeErpSyncService.syncPurchaseOrderFromErp(0));
|
|
|
|
}
|
|
|
|
} catch (Exception e) {
|
|
|
|
catch (Exception e) {
|
|
|
|
logger.error("同步采购订单信息错误:" + e.getMessage());
|
|
|
|
return AjaxResult.error();
|
|
|
|
return AjaxResult.error();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 单一采购申请单保存->提交->审核
|
|
|
|
* 单一采购申请单保存->提交->审核
|
|
|
|
*
|
|
|
|
*
|
|
|
@ -149,6 +146,7 @@ public class KingdeeErpSyncController {
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 其他出库单保存->提交->审核
|
|
|
|
* 其他出库单保存->提交->审核
|
|
|
|
|
|
|
|
*
|
|
|
|
* @param params {"FMaterialId": "01150020","FDate": "2024-04-12 00:00:00","FUnitID": "zhi1","FStockId": "CK052","FAuxPropId": "304不锈钢滤帽","FQty": 4.0000,"FPrice": 20.3}
|
|
|
|
* @param params {"FMaterialId": "01150020","FDate": "2024-04-12 00:00:00","FUnitID": "zhi1","FStockId": "CK052","FAuxPropId": "304不锈钢滤帽","FQty": 4.0000,"FPrice": 20.3}
|
|
|
|
* @return {"msg": "{\"IsSuccess\":true,\"Errors\":[],\"SuccessEntitys\":[{\"Id\":\"116470\",\"Number\":\"QTCK004153\",\"DIndex\":0}]}","code": 200}
|
|
|
|
* @return {"msg": "{\"IsSuccess\":true,\"Errors\":[],\"SuccessEntitys\":[{\"Id\":\"116470\",\"Number\":\"QTCK004153\",\"DIndex\":0}]}","code": 200}
|
|
|
|
*/
|
|
|
|
*/
|
|
|
@ -164,6 +162,7 @@ public class KingdeeErpSyncController {
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 其他入库单保存->提交->审核
|
|
|
|
* 其他入库单保存->提交->审核
|
|
|
|
|
|
|
|
*
|
|
|
|
* @param params {"FMaterialId": "01150020","FDate": "2024-04-12 00:00:00","FUnitID": "zhi1","FStockId": "CK052","FAuxPropId": "304不锈钢滤帽","FQty": 4.0000,"FPrice": 20.3}
|
|
|
|
* @param params {"FMaterialId": "01150020","FDate": "2024-04-12 00:00:00","FUnitID": "zhi1","FStockId": "CK052","FAuxPropId": "304不锈钢滤帽","FQty": 4.0000,"FPrice": 20.3}
|
|
|
|
* @return { "msg": "{\"IsSuccess\":true,\"Errors\":[],\"SuccessEntitys\":[{\"Id\":\"100418\",\"Number\":\"QTRK000352\",\"DIndex\":0}]}", "code": 200}
|
|
|
|
* @return { "msg": "{\"IsSuccess\":true,\"Errors\":[],\"SuccessEntitys\":[{\"Id\":\"100418\",\"Number\":\"QTRK000352\",\"DIndex\":0}]}", "code": 200}
|
|
|
|
*/
|
|
|
|
*/
|
|
|
@ -253,5 +252,4 @@ public class KingdeeErpSyncController {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|