修改定时任务返回
This commit is contained in:
@@ -23,7 +23,6 @@ public class ErpSubmitReqDTO {
|
|||||||
* "sign": 签名,uuid+srcsys+密码,MD5 32位小写签名,密码另行约定
|
* "sign": 签名,uuid+srcsys+密码,MD5 32位小写签名,密码另行约定
|
||||||
* "req": {具体参数,参见RFC功能列表}
|
* "req": {具体参数,参见RFC功能列表}
|
||||||
*/
|
*/
|
||||||
private String srcsys;
|
|
||||||
private String funcnr;
|
private String funcnr;
|
||||||
private String bskey;
|
private String bskey;
|
||||||
private String usrid;
|
private String usrid;
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ public ResponseEntity<String> pushDataToErp(ErpSubmitReqDTO reqDTO) {
|
|||||||
JSONObject requestBody = new JSONObject();
|
JSONObject requestBody = new JSONObject();
|
||||||
requestBody.put("uuid", UUID.randomUUID().toString());
|
requestBody.put("uuid", UUID.randomUUID().toString());
|
||||||
requestBody.put("sapsys", sapsys);
|
requestBody.put("sapsys", sapsys);
|
||||||
requestBody.put("srcsys", reqDTO.getSrcsys());
|
requestBody.put("srcsys", "DSC");
|
||||||
requestBody.put("funcnr", reqDTO.getFuncnr());
|
requestBody.put("funcnr", reqDTO.getFuncnr());
|
||||||
requestBody.put("bskey", reqDTO.getBskey());
|
requestBody.put("bskey", reqDTO.getBskey());
|
||||||
requestBody.put("usrid", reqDTO.getUsrid());
|
requestBody.put("usrid", reqDTO.getUsrid());
|
||||||
|
|||||||
@@ -104,7 +104,8 @@ public class ErpAssetController {
|
|||||||
@PostMapping("/getErpAssetTask")
|
@PostMapping("/getErpAssetTask")
|
||||||
@Operation(summary = "定时获得erp更新资产卡片")
|
@Operation(summary = "定时获得erp更新资产卡片")
|
||||||
@PreAuthorize("@ss.hasPermission('sply:erp-asset:create')")
|
@PreAuthorize("@ss.hasPermission('sply:erp-asset:create')")
|
||||||
public void getErpCompanyTask() {
|
public CommonResult<Boolean> getErpCompanyTask() {
|
||||||
erpAssetService.callErpRfcInterface();
|
erpAssetService.callErpRfcInterface();
|
||||||
|
return success(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -104,8 +104,9 @@ public class ErpBomController {
|
|||||||
@PostMapping("/getErpBomTask")
|
@PostMapping("/getErpBomTask")
|
||||||
@Operation(summary = "定时获得erp更新物料清单(BOM)")
|
@Operation(summary = "定时获得erp更新物料清单(BOM)")
|
||||||
@PreAuthorize("@ss.hasPermission('sply:erp-bom:create')")
|
@PreAuthorize("@ss.hasPermission('sply:erp-bom:create')")
|
||||||
public void getErpBomTask() {
|
public CommonResult<Boolean> getErpBomTask() {
|
||||||
erpBomService.callErpRfcInterface();
|
erpBomService.callErpRfcInterface();
|
||||||
|
return CommonResult.success(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/submitDataToErp")
|
@PostMapping("/submitDataToErp")
|
||||||
|
|||||||
@@ -104,8 +104,9 @@ public class ErpCompanyController {
|
|||||||
@PostMapping("/getErpCompanyTask")
|
@PostMapping("/getErpCompanyTask")
|
||||||
@Operation(summary = "定时获得erp更新公司")
|
@Operation(summary = "定时获得erp更新公司")
|
||||||
@PreAuthorize("@ss.hasPermission('sply:erp-company:create')")
|
@PreAuthorize("@ss.hasPermission('sply:erp-company:create')")
|
||||||
public void getErpCompanyTask() {
|
public CommonResult<Boolean> getErpCompanyTask() {
|
||||||
erpCompanyService.callErpRfcInterface();
|
erpCompanyService.callErpRfcInterface();
|
||||||
|
return success(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -104,7 +104,8 @@ public class ErpContractController {
|
|||||||
@PostMapping("/getErpContractTask")
|
@PostMapping("/getErpContractTask")
|
||||||
@Operation(summary = "定时获得erp更新合同")
|
@Operation(summary = "定时获得erp更新合同")
|
||||||
@PreAuthorize("@ss.hasPermission('sply:erp-contract:create')")
|
@PreAuthorize("@ss.hasPermission('sply:erp-contract:create')")
|
||||||
public void getErpContractTask() {
|
public CommonResult<Boolean> getErpContractTask() {
|
||||||
erpContractService.callErpRfcInterface();
|
erpContractService.callErpRfcInterface();
|
||||||
|
return success(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -104,8 +104,9 @@ public class ErpCostcenterController {
|
|||||||
@PostMapping("/getErpCostcenterTask")
|
@PostMapping("/getErpCostcenterTask")
|
||||||
@Operation(summary = "定时获得erp更新成本中心")
|
@Operation(summary = "定时获得erp更新成本中心")
|
||||||
@PreAuthorize("@ss.hasPermission('sply:erp-costcenter:create')")
|
@PreAuthorize("@ss.hasPermission('sply:erp-costcenter:create')")
|
||||||
public void getErpCostcenterTask() {
|
public CommonResult<Boolean> getErpCostcenterTask() {
|
||||||
erpCostcenterService.callErpRfcInterface();
|
erpCostcenterService.callErpRfcInterface();
|
||||||
|
return success(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -104,7 +104,8 @@ public class ErpCustomerController {
|
|||||||
@PostMapping("/getErpCustomerTask")
|
@PostMapping("/getErpCustomerTask")
|
||||||
@Operation(summary = "定时获得erp更新客商主数据")
|
@Operation(summary = "定时获得erp更新客商主数据")
|
||||||
@PreAuthorize("@ss.hasPermission('sply:erp-customer:create')")
|
@PreAuthorize("@ss.hasPermission('sply:erp-customer:create')")
|
||||||
public void getErpCustomerTask() {
|
public CommonResult<Boolean> getErpCustomerTask() {
|
||||||
erpCustomerService.callErpRfcInterface();
|
erpCustomerService.callErpRfcInterface();
|
||||||
|
return success(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -104,8 +104,9 @@ public class ErpFactoryController {
|
|||||||
@PostMapping("/getErpFactoryTask")
|
@PostMapping("/getErpFactoryTask")
|
||||||
@Operation(summary = "定时获得erp工厂数据")
|
@Operation(summary = "定时获得erp工厂数据")
|
||||||
@PreAuthorize("@ss.hasPermission('sply:erp-factory:create')")
|
@PreAuthorize("@ss.hasPermission('sply:erp-factory:create')")
|
||||||
public void getErpFactoryTask() {
|
public CommonResult<Boolean> getErpFactoryTask() {
|
||||||
erpFactoryService.callErpRfcInterface();
|
erpFactoryService.callErpRfcInterface();
|
||||||
|
return success(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -104,8 +104,9 @@ public class ErpInternalOrderController {
|
|||||||
@PostMapping("/getErpInternalOrderTask")
|
@PostMapping("/getErpInternalOrderTask")
|
||||||
@Operation(summary = "定时获得erp更新内部订单数据")
|
@Operation(summary = "定时获得erp更新内部订单数据")
|
||||||
@PreAuthorize("@ss.hasPermission('sply:erp-internal-order:create')")
|
@PreAuthorize("@ss.hasPermission('sply:erp-internal-order:create')")
|
||||||
public void getErpInternalOrderTask() {
|
public CommonResult<Boolean> getErpInternalOrderTask() {
|
||||||
erpInternalOrderService.callErpRfcInterface();
|
erpInternalOrderService.callErpRfcInterface();
|
||||||
|
return success(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -104,8 +104,9 @@ public class ErpMaterialController {
|
|||||||
@PostMapping("/getErpMaterialTask")
|
@PostMapping("/getErpMaterialTask")
|
||||||
@Operation(summary = "定时获得erp更新物料")
|
@Operation(summary = "定时获得erp更新物料")
|
||||||
@PreAuthorize("@ss.hasPermission('sply:erp-material:create')")
|
@PreAuthorize("@ss.hasPermission('sply:erp-material:create')")
|
||||||
public void getErpMaterialTask() {
|
public CommonResult<Boolean> getErpMaterialTask() {
|
||||||
erpMaterialService.callErpRfcInterface();
|
erpMaterialService.callErpRfcInterface();
|
||||||
|
return success(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -104,8 +104,9 @@ public class ErpProcessController {
|
|||||||
@PostMapping("/getErpProcessTask")
|
@PostMapping("/getErpProcessTask")
|
||||||
@Operation(summary = "定时获得erp更新工艺路线")
|
@Operation(summary = "定时获得erp更新工艺路线")
|
||||||
@PreAuthorize("@ss.hasPermission('sply:erp-process:create')")
|
@PreAuthorize("@ss.hasPermission('sply:erp-process:create')")
|
||||||
public void getErpProcessTask() {
|
public CommonResult<Boolean> getErpProcessTask() {
|
||||||
erpProcessService.callErpRfcInterface();
|
erpProcessService.callErpRfcInterface();
|
||||||
|
return success(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -104,8 +104,9 @@ public class ErpProductiveOrderController {
|
|||||||
@PostMapping("/getErpProductiveOrderTask")
|
@PostMapping("/getErpProductiveOrderTask")
|
||||||
@Operation(summary = "定时获得erp更新生产订单")
|
@Operation(summary = "定时获得erp更新生产订单")
|
||||||
@PreAuthorize("@ss.hasPermission('sply:erp-productive-order:create')")
|
@PreAuthorize("@ss.hasPermission('sply:erp-productive-order:create')")
|
||||||
public void getErpProductiveOrderTask() {
|
public CommonResult<Boolean> getErpProductiveOrderTask() {
|
||||||
erpProductiveOrderService.callErpRfcInterface();
|
erpProductiveOrderService.callErpRfcInterface();
|
||||||
|
return success(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -104,8 +104,9 @@ public class ErpProductiveVersionController {
|
|||||||
@PostMapping("/getErpProductiveVersionTask")
|
@PostMapping("/getErpProductiveVersionTask")
|
||||||
@Operation(summary = "定时获得erp更新生产版本")
|
@Operation(summary = "定时获得erp更新生产版本")
|
||||||
@PreAuthorize("@ss.hasPermission('sply:erp-productive-version:create')")
|
@PreAuthorize("@ss.hasPermission('sply:erp-productive-version:create')")
|
||||||
public void getErpProductiveVersionTask() {
|
public CommonResult<Boolean> getErpProductiveVersionTask() {
|
||||||
erpProductiveVersionService.callErpRfcInterface();
|
erpProductiveVersionService.callErpRfcInterface();
|
||||||
|
return success(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -104,8 +104,9 @@ public class ErpPurchaseOrganizationController {
|
|||||||
@PostMapping("/getErpPurchaseOrganizationTask")
|
@PostMapping("/getErpPurchaseOrganizationTask")
|
||||||
@Operation(summary = "定时获得erp更新采购组织")
|
@Operation(summary = "定时获得erp更新采购组织")
|
||||||
@PreAuthorize("@ss.hasPermission('sply:erp-purchase-organization:create')")
|
@PreAuthorize("@ss.hasPermission('sply:erp-purchase-organization:create')")
|
||||||
public void getErpPurchaseOrganizationTask() {
|
public CommonResult<Boolean> getErpPurchaseOrganizationTask() {
|
||||||
erpPurchaseOrganizationService.callErpRfcInterface();
|
erpPurchaseOrganizationService.callErpRfcInterface();
|
||||||
|
return success(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -104,8 +104,9 @@ public class ErpSalesOrganizationController {
|
|||||||
@PostMapping("/getErpSalesOrganizationTask")
|
@PostMapping("/getErpSalesOrganizationTask")
|
||||||
@Operation(summary = "定时获得erp更新销售组织")
|
@Operation(summary = "定时获得erp更新销售组织")
|
||||||
@PreAuthorize("@ss.hasPermission('sply:erp-sales-organization:create')")
|
@PreAuthorize("@ss.hasPermission('sply:erp-sales-organization:create')")
|
||||||
public void getErpSalesOrganizationTask() {
|
public CommonResult<Boolean> getErpSalesOrganizationTask() {
|
||||||
erpSalesOrganizationService.callErpRfcInterface();
|
erpSalesOrganizationService.callErpRfcInterface();
|
||||||
|
return success(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -104,8 +104,9 @@ public class ErpWarehouseController {
|
|||||||
@PostMapping("/getErpWarehouseTask")
|
@PostMapping("/getErpWarehouseTask")
|
||||||
@Operation(summary = "定时获得erp更新库位")
|
@Operation(summary = "定时获得erp更新库位")
|
||||||
@PreAuthorize("@ss.hasPermission('sply:erp-warehouse:create')")
|
@PreAuthorize("@ss.hasPermission('sply:erp-warehouse:create')")
|
||||||
public void getErpWarehouseTask() {
|
public CommonResult<Boolean> getErpWarehouseTask() {
|
||||||
erpWarehouseService.callErpRfcInterface();
|
erpWarehouseService.callErpRfcInterface();
|
||||||
|
return success(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -126,7 +126,7 @@ public class ErpBomServiceImpl implements ErpBomService {
|
|||||||
String factKey = "erpMap" + OftenEnum.FuncnrEnum.工厂信息.getFuncnr();
|
String factKey = "erpMap" + OftenEnum.FuncnrEnum.工厂信息.getFuncnr();
|
||||||
Map<String, Long> redisCache = erpConfig.getRedisCacheMap(factKey);
|
Map<String, Long> redisCache = erpConfig.getRedisCacheMap(factKey);
|
||||||
if (CollUtil.isEmpty(redisCache)) {
|
if (CollUtil.isEmpty(redisCache)) {
|
||||||
return;
|
throw exception(ERP_BOM_NOT_EXISTS);
|
||||||
}
|
}
|
||||||
for (String factoryNumber : redisCache.keySet()) {
|
for (String factoryNumber : redisCache.keySet()) {
|
||||||
req.put("WERKS", factoryNumber);
|
req.put("WERKS", factoryNumber);
|
||||||
@@ -158,74 +158,86 @@ public class ErpBomServiceImpl implements ErpBomService {
|
|||||||
Map<String, Long> numbers = erpConfig.getRedisCacheMap(key);
|
Map<String, Long> numbers = erpConfig.getRedisCacheMap(key);
|
||||||
List<ErpBomDO> toUpdate = new ArrayList<>();
|
List<ErpBomDO> toUpdate = new ArrayList<>();
|
||||||
|
|
||||||
List<String> allnumbers = new ArrayList<>();
|
|
||||||
List<ErpBomDetailDO> erpBomDetailDOList = new ArrayList<>();
|
List<ErpBomDetailDO> erpBomDetailDOList = new ArrayList<>();
|
||||||
Map<String, Long> addnumbers = new HashMap<>();
|
Map<String, Long> addnumbers = new HashMap<>();
|
||||||
List<String> dataArrayNumbers = new ArrayList<>();
|
List<String> dataArrayNumbers = new ArrayList<>();
|
||||||
|
|
||||||
for (int i = 0; i < dataArray.size(); i++) {
|
for (int i = 0; i < dataArray.size(); i++) {
|
||||||
JSONObject dataJson = dataArray.getJSONObject(i);
|
JSONObject dataJson = dataArray.getJSONObject(i);
|
||||||
if (dataJson != null) {
|
if (dataJson != null) {
|
||||||
ErpBomDO DO = new ErpBomDO();
|
ErpBomDO bomDO = new ErpBomDO();
|
||||||
DO.setFactoryNumber(dataJson.getString("WERKS"));
|
bomDO.setFactoryNumber(dataJson.getString("WERKS"));
|
||||||
DO.setUpMaterial(dataJson.getString("MATNR"));
|
bomDO.setUpMaterial(dataJson.getString("MATNR"));
|
||||||
DO.setUseItem(dataJson.getString("STLAL"));
|
bomDO.setUseItem(dataJson.getString("STLAL"));
|
||||||
// DO.set(dataJson.getString("STLAN"));数据库无这个字段
|
bomDO.setMaterialDescription(dataJson.getString("MAKTX"));
|
||||||
DO.setMaterialDescription(dataJson.getString("MAKTX"));
|
bomDO.setQuantity(dataJson.getBigDecimal("BMENG"));
|
||||||
DO.setQuantity(dataJson.getBigDecimal("BMENG"));
|
bomDO.setUnit(dataJson.getString("BMEIN"));
|
||||||
DO.setUnit(dataJson.getString("BMEIN"));
|
|
||||||
String number = DO.getFactoryNumber() + "-" + DO.getUpMaterial() + "-" + DO.getUseItem();
|
String number = bomDO.getFactoryNumber() + "-" + bomDO.getUpMaterial() + "-" + bomDO.getUseItem();
|
||||||
if (numbers.get(number) != null) {
|
|
||||||
// 更新
|
|
||||||
DO.setId(numbers.get(number));
|
|
||||||
toUpdate.add(DO);
|
|
||||||
} else {
|
|
||||||
// 为了避免数据重复,先将主表数据插入数据库,再获取主表ID,再插入子表数据
|
|
||||||
erpBomMapper.insert(DO);
|
|
||||||
addnumbers.put(number, DO.getId());
|
|
||||||
}
|
|
||||||
dataArrayNumbers.add(number);
|
dataArrayNumbers.add(number);
|
||||||
|
|
||||||
|
if (numbers.containsKey(number)) {
|
||||||
|
// 更新
|
||||||
|
bomDO.setId(numbers.get(number));
|
||||||
|
toUpdate.add(bomDO);
|
||||||
|
} else {
|
||||||
|
// 新增
|
||||||
|
erpBomMapper.insert(bomDO);
|
||||||
|
addnumbers.put(number, bomDO.getId());
|
||||||
|
}
|
||||||
|
|
||||||
JSONArray dataJsonItem = dataJson.getJSONArray("ITEM");
|
JSONArray dataJsonItem = dataJson.getJSONArray("ITEM");
|
||||||
if (dataJsonItem != null) {
|
if (dataJsonItem != null && !dataJsonItem.isEmpty()) {
|
||||||
for (int j = 0; j < dataJsonItem.size(); j++) {
|
for (int j = 0; j < dataJsonItem.size(); j++) {
|
||||||
JSONObject dataJsonItemJson = dataJsonItem.getJSONObject(j);
|
JSONObject itemJson = dataJsonItem.getJSONObject(j);
|
||||||
ErpBomDetailDO detailDO = new ErpBomDetailDO();
|
ErpBomDetailDO detailDO = new ErpBomDetailDO();
|
||||||
detailDO.setBomId(String.valueOf(DO.getId()));
|
detailDO.setBomId(String.valueOf(bomDO.getId()));
|
||||||
detailDO.setErpBomId(dataJsonItemJson.getString("STVKN"));
|
detailDO.setErpBomId(itemJson.getString("STVKN"));
|
||||||
detailDO.setChildMaterialNumber(dataJsonItemJson.getString("IDNRK"));
|
detailDO.setChildMaterialNumber(itemJson.getString("IDNRK"));
|
||||||
detailDO.setChildMaterialDescription(dataJsonItemJson.getString("OJTXP"));
|
detailDO.setChildMaterialDescription(itemJson.getString("OJTXP"));
|
||||||
detailDO.setCategory(dataJsonItemJson.getString("POSTP"));
|
detailDO.setCategory(itemJson.getString("POSTP"));
|
||||||
detailDO.setQuantity(dataJsonItemJson.getBigDecimal("MENGE"));
|
detailDO.setQuantity(itemJson.getBigDecimal("MENGE"));
|
||||||
detailDO.setUnit(dataJsonItemJson.getString("MEINS"));
|
detailDO.setUnit(itemJson.getString("MEINS"));
|
||||||
detailDO.setIdentificationType(dataJsonItemJson.getString("WLCAT"));
|
detailDO.setIdentificationType(itemJson.getString("WLCAT"));
|
||||||
erpBomDetailDOList.add(detailDO);
|
erpBomDetailDOList.add(detailDO);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 过滤出numbers中有,但dataArray中KOSTL没有的记录,即为需要删除的数据
|
// 识别需要删除的数据
|
||||||
Map<String, Long> deleteNumbers = new HashMap<>();
|
List<String> deleteNumbers = new ArrayList<>();
|
||||||
for (String number : numbers.keySet()) {
|
for (String number : numbers.keySet()) {
|
||||||
if (!dataArrayNumbers.contains(number)) {
|
if (!dataArrayNumbers.contains(number)) {
|
||||||
deleteNumbers.put(number, numbers.get(number));
|
deleteNumbers.add(number);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return new ProcessingResult(toUpdate, erpBomDetailDOList, key, allnumbers);
|
return new ProcessingResult(toUpdate, key, addnumbers, deleteNumbers, erpBomDetailDOList);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量保存数据
|
* 批量保存数据
|
||||||
*/
|
*/
|
||||||
private void saveData(ProcessingResult result) {
|
private void saveData(ProcessingResult result) {
|
||||||
// 批量新增和更新
|
// 批量更新
|
||||||
if (!result.toUpdate.isEmpty()) {
|
if (!result.toUpdate.isEmpty()) {
|
||||||
erpBomMapper.updateBatch(result.toUpdate);
|
erpBomMapper.updateBatch(result.toUpdate);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 保存或更新BOM详情
|
||||||
if (!result.erpBomDetailDOList.isEmpty()) {
|
if (!result.erpBomDetailDOList.isEmpty()) {
|
||||||
bomDetailService.saveOrUpdateErpBomDetail(result.erpBomDetailDOList);
|
bomDetailService.saveOrUpdateErpBomDetail(result.erpBomDetailDOList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 更新Redis缓存
|
||||||
|
if (!result.addnumbers.isEmpty()) {
|
||||||
|
erpConfig.addRedisCacheMap(result.key, result.addnumbers);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!result.deleteNumbers.isEmpty()) {
|
||||||
|
erpConfig.deleteRedisCacheMap(result.key, result.deleteNumbers);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -233,24 +245,27 @@ public class ErpBomServiceImpl implements ErpBomService {
|
|||||||
*/
|
*/
|
||||||
private static class ProcessingResult {
|
private static class ProcessingResult {
|
||||||
private final List<ErpBomDO> toUpdate;
|
private final List<ErpBomDO> toUpdate;
|
||||||
private final List<ErpBomDetailDO> erpBomDetailDOList;
|
|
||||||
private final String key;
|
private final String key;
|
||||||
private final List<String> allnumbers;
|
private final Map<String, Long> addnumbers;
|
||||||
|
private final List<String> deleteNumbers;
|
||||||
|
private final List<ErpBomDetailDO> erpBomDetailDOList;
|
||||||
|
|
||||||
public ProcessingResult(List<ErpBomDO> toUpdate, List<ErpBomDetailDO> erpBomDetailDOList, String key, List<String> allnumbers) {
|
public ProcessingResult(List<ErpBomDO> toUpdate, String key, Map<String, Long> addnumbers,
|
||||||
|
List<String> deleteNumbers, List<ErpBomDetailDO> erpBomDetailDOList) {
|
||||||
this.toUpdate = toUpdate;
|
this.toUpdate = toUpdate;
|
||||||
this.erpBomDetailDOList = erpBomDetailDOList;
|
|
||||||
this.key = key;
|
this.key = key;
|
||||||
this.allnumbers = allnumbers;
|
this.addnumbers = addnumbers;
|
||||||
|
this.deleteNumbers = deleteNumbers;
|
||||||
|
this.erpBomDetailDOList = erpBomDetailDOList;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initializeMap(String key) {
|
private void initializeMap(String key) {
|
||||||
List<ErpBomDO> assets = erpBomMapper.selectList(new LambdaQueryWrapperX<ErpBomDO>());
|
List<ErpBomDO> bomList = erpBomMapper.selectList(new LambdaQueryWrapperX<ErpBomDO>());
|
||||||
Map<String, Long> existingNumbers = new HashMap<>();
|
Map<String, Long> existingNumbers = new HashMap<>();
|
||||||
for (ErpBomDO asset : assets) {
|
for (ErpBomDO bom : bomList) {
|
||||||
String mapKey = asset.getFactoryNumber() + "-" + asset.getUpMaterial() + "-" + asset.getUseItem();
|
String mapKey = bom.getFactoryNumber() + "-" + bom.getUpMaterial() + "-" + bom.getUseItem();
|
||||||
existingNumbers.put(mapKey, asset.getId());
|
existingNumbers.put(mapKey, bom.getId());
|
||||||
}
|
}
|
||||||
erpConfig.addRedisCacheMap(key, existingNumbers);
|
erpConfig.addRedisCacheMap(key, existingNumbers);
|
||||||
}
|
}
|
||||||
@@ -259,7 +274,6 @@ public class ErpBomServiceImpl implements ErpBomService {
|
|||||||
@Override
|
@Override
|
||||||
public void submitDataToErp() {
|
public void submitDataToErp() {
|
||||||
ErpSubmitReqDTO reqDTO = new ErpSubmitReqDTO();
|
ErpSubmitReqDTO reqDTO = new ErpSubmitReqDTO();
|
||||||
reqDTO.setSrcsys("MOM");
|
|
||||||
reqDTO.setFuncnr("061");
|
reqDTO.setFuncnr("061");
|
||||||
reqDTO.setBskey("POTEST011");
|
reqDTO.setBskey("POTEST011");
|
||||||
reqDTO.setUsrid("cuibin");
|
reqDTO.setUsrid("cuibin");
|
||||||
|
|||||||
Reference in New Issue
Block a user