提交 8bd1fa35 authored 作者: inroi's avatar inroi

微调

上级 ef1192d6
package com.system.controller;
import com.system.transfer.configure.InitConnectParamCreateInVo;
import com.system.transfer.response.RestResponse;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @author Inori
*/
@Api(tags = "商城同步配置")
@RestController
@RequestMapping("/api")
public class MallCommonSyncConfigController {
@PostMapping("/init/connect/param/create")
public RestResponse initConnectParamCreate(@RequestBody InitConnectParamCreateInVo inVo) {
return RestResponse.success();
}
}
......@@ -11,7 +11,7 @@ import org.springframework.web.bind.annotation.*;
/**
* @author Inori
*/
@Api(tags = "自动同步")
@Api(tags = "商城同步")
@RestController
@RequestMapping("/api")
public class MallCommonSyncController {
......
......@@ -28,8 +28,9 @@ public class MallLoginScheduler {
InitConnectParam initConnectParam = commonHttpApi.getInitConnectParam();
if (StringUtil.isNotNull(initConnectParam)) {
Boolean flag;
boolean flag;
try {
//TODO 商城登陆
flag = true;
} catch (Exception e) {
flag = false;
......
package com.system.serivce;
/**
* @author Inori
*/
public interface IMallCommonSyncConfigService {
}
......@@ -60,17 +60,22 @@ public class IMallSyncServiceImpl implements IMallSyncService {
return;
}
Map<String, Object> where = new HashMap<>(3);
where.put("dataId", dataId);
if (StringUtil.isNotNull(entryId)) {
where.put("entryId", entryId);
}
Map<String, Object> map = mallCommonSyncApi.synchronization(config, queueId, config.get("name"), where);
if (!Constants.SUCCESS_CODE.equals(String.valueOf(map.get(Constants.SUCCESS_NAME)))) {
synchronizationRecordsMapper.synchronizationRecordsUpdate(new SynchronizationRecordsUpdateInVo(id, queueId, String.valueOf(map.get(Constants.ERROR_MESSAGE)), 2));
return;
Map<String, Object> map = new HashMap<>();
String customSql = config.get("customSql");
if (!StringUtil.isNotBlank(customSql)) {
//TODO SQL查询
} else {
Map<String, Object> where = new HashMap<>(3);
where.put("dataId", dataId);
if (StringUtil.isNotNull(entryId)) {
where.put("entryId", entryId);
}
map = mallCommonSyncApi.synchronization(config, queueId, config.get("name"), where);
if (!Constants.SUCCESS_CODE.equals(String.valueOf(map.get(Constants.SUCCESS_NAME)))) {
synchronizationRecordsMapper.synchronizationRecordsUpdate(new SynchronizationRecordsUpdateInVo(id, queueId, String.valueOf(map.get(Constants.ERROR_MESSAGE)), 2));
return;
}
}
this.encapsulationRequest(config, operation, queueId, id, map);
......
package com.system.serivce.impl;
import com.system.serivce.IMallCommonSyncConfigService;
import org.springframework.stereotype.Service;
/**
* @author Inori
*/
@Service
public class MallCommonSyncConfigServiceImpl implements IMallCommonSyncConfigService {
}
......@@ -6,6 +6,7 @@ import com.system.mall.MallCommonApi;
import com.system.serivce.ISynchronizationService;
import com.system.transfer.mall.MallTriggerSynchronizationInVo;
import com.system.transfer.mall.SynchronizationRecordsListOutVoRecords;
import com.system.utils.JsonUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
......@@ -60,6 +61,7 @@ public class SynchronizationServiceImpl implements ISynchronizationService {
@Transactional(rollbackFor = Exception.class)
public void synchronization(List<Integer> request) {
System.out.println(JsonUtil.toString(request));
List<Map<String, Object>> tempList = mallCommonApi.getSynchronizationRecords(request);
if (!CollectionUtils.isEmpty(tempList)) {
......
package com.system.transfer.configure;
import lombok.Data;
/**
* @author Inori
*/
@Data
public class InitConnectParamCreateInVo {
/**
* 商城地址
*/
private String mallAddress;
/**
* 用户名
*/
private String account;
/**
* 密码
*/
private String password;
/**
* 任务时长/分钟
*/
private Integer duration;
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论