提交 94c7f9be authored 作者: inroi's avatar inroi
...@@ -29,6 +29,7 @@ public class KingDeeSyncController { ...@@ -29,6 +29,7 @@ public class KingDeeSyncController {
@ApiOperation("金蝶同步") @ApiOperation("金蝶同步")
@GetMapping("/kingdee/synchronization") @GetMapping("/kingdee/synchronization")
public RestResponse kingdeeSynchronization() { public RestResponse kingdeeSynchronization() {
System.out.println("金蝶同步====");
synchronizationService.kingdeeSynchronization(); synchronizationService.kingdeeSynchronization();
return RestResponse.success(); return RestResponse.success();
} }
...@@ -36,6 +37,7 @@ public class KingDeeSyncController { ...@@ -36,6 +37,7 @@ public class KingDeeSyncController {
@ApiOperation("手动同步") @ApiOperation("手动同步")
@GetMapping("/kingdee/manual/synchronization") @GetMapping("/kingdee/manual/synchronization")
public RestResponse manualSynchronization() { public RestResponse manualSynchronization() {
System.out.println("手动同步====");
synchronizationService.kingdeeManualSynchronization(); synchronizationService.kingdeeManualSynchronization();
return RestResponse.success(); return RestResponse.success();
} }
...@@ -43,6 +45,7 @@ public class KingDeeSyncController { ...@@ -43,6 +45,7 @@ public class KingDeeSyncController {
@ApiOperation("手动同步(带参数)") @ApiOperation("手动同步(带参数)")
@PostMapping("/kingdee/manual/synchronizationByParam") @PostMapping("/kingdee/manual/synchronizationByParam")
public RestResponse manualSynchronizationByParam(@RequestBody Map<String, String> docTypeMap) { public RestResponse manualSynchronizationByParam(@RequestBody Map<String, String> docTypeMap) {
System.out.println("手动同步(带参数)===="+docTypeMap);
synchronizationService.manualSynchronizationByParam(docTypeMap.get("docType")); synchronizationService.manualSynchronizationByParam(docTypeMap.get("docType"));
return RestResponse.success(); return RestResponse.success();
} }
......
...@@ -194,8 +194,9 @@ public class KingDeeCommonSyncServiceImpl implements IKingDeeCommonSyncService { ...@@ -194,8 +194,9 @@ public class KingDeeCommonSyncServiceImpl implements IKingDeeCommonSyncService {
* 同步至第三方 * 同步至第三方
*/ */
private void encapsulationRequest(Map<String, String> config, String queueId, Integer id, List<Map<String, Object>> dataList) { private void encapsulationRequest(Map<String, String> config, String queueId, Integer id, List<Map<String, Object>> dataList) {
System.out.println("dataList"+dataList);
for(Map<String, Object> curData:dataList){ for(Map<String, Object> curData:dataList){
curData.put("docType",config.get("docType"));
System.out.println("curData"+curData);
String response = kingDeeCommonSyncApi.sendThirdParty(JsonUtil.toString(curData)); String response = kingDeeCommonSyncApi.sendThirdParty(JsonUtil.toString(curData));
response = unicodeToString(response); response = unicodeToString(response);
......
...@@ -67,6 +67,7 @@ public class SynchronizationServiceImpl implements ISynchronizationService { ...@@ -67,6 +67,7 @@ public class SynchronizationServiceImpl implements ISynchronizationService {
@Override @Override
public void kingdeeManualSynchronization() { public void kingdeeManualSynchronization() {
System.out.println("kingdeeManualSynchronization=====");
threadPool.execute(() -> { threadPool.execute(() -> {
List<SynchronizationRecordsListOutVoRecords> recordsList = synchronizationRecordsMapper.synchronizationRecordsListByStatus(Stream.of(1, 2).collect(Collectors.toList())); List<SynchronizationRecordsListOutVoRecords> recordsList = synchronizationRecordsMapper.synchronizationRecordsListByStatus(Stream.of(1, 2).collect(Collectors.toList()));
...@@ -123,12 +124,13 @@ public class SynchronizationServiceImpl implements ISynchronizationService { ...@@ -123,12 +124,13 @@ public class SynchronizationServiceImpl implements ISynchronizationService {
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void synchronization() { public void synchronization() {
System.out.println("synchronization=====");
List<Map<String, Object>> tempList = kingDeeSynchronizationApi.synchronization(); List<Map<String, Object>> tempList = kingDeeSynchronizationApi.synchronization();
if (!CollectionUtils.isEmpty(tempList)) { if (!CollectionUtils.isEmpty(tempList)) {
synchronizationRecordsMapper.synchronizationRecordsTempCreate(tempList); synchronizationRecordsMapper.synchronizationRecordsTempCreate(tempList);
} }
System.out.println("tempList===="+tempList);
List<String> objectList = tempList.stream().filter(m -> !"LQKJ_IMSSync".equals(m.get("sFormId"))).map(m -> String.valueOf(m.get("fid"))).collect(Collectors.toList()); List<String> objectList = tempList.stream().filter(m -> !"LQKJ_IMSSync".equals(m.get("sFormId"))).map(m -> String.valueOf(m.get("fid"))).collect(Collectors.toList());
List<Map<String, Object>> dataList = new ArrayList<>(); List<Map<String, Object>> dataList = new ArrayList<>();
...@@ -157,7 +159,8 @@ public class SynchronizationServiceImpl implements ISynchronizationService { ...@@ -157,7 +159,8 @@ public class SynchronizationServiceImpl implements ISynchronizationService {
if (!CollectionUtils.isEmpty(idList)) { if (!CollectionUtils.isEmpty(idList)) {
synchronizationRecordsMapper.synchronizationRecordsUpdateByIdList(idList); synchronizationRecordsMapper.synchronizationRecordsUpdateByIdList(idList);
} }
System.out.println("idList===="+idList);
System.out.println("recordsList===="+recordsList);
for (SynchronizationRecordsListOutVoRecords records : recordsList) { for (SynchronizationRecordsListOutVoRecords records : recordsList) {
if (!"LQKJ_IMSSync".equals(records.getSFormId())) { if (!"LQKJ_IMSSync".equals(records.getSFormId())) {
kingDeeCommonSyncService.synchronization(records.getId(), records.getSFormId(), records.getDataId(), records.getEntryId()); kingDeeCommonSyncService.synchronization(records.getId(), records.getSFormId(), records.getDataId(), records.getEntryId());
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论