更新相关的业务逻辑

master
土豆兄弟 4 years ago
parent e185a341f6
commit 38c921389e

@ -50,10 +50,9 @@ public class ABClient {
log.info("====== [ one request comming,request content is {} ] ======", vo.toString()); log.info("====== [ one request comming,request content is {} ] ======", vo.toString());
// 转换实体类映射 // 转换实体类映射
List<ABMessageDTO> dtos = ABMessageConverter.convertABMessageDTOFromVO(vo); List<ABMessageDTO> dtos = ABMessageConverter.convertABMessageDTOFromVO(vo);
// 调用业务处理接口 // 调用业务处理接口 返回校验成功的结果
abClientService.recordAndSendABClientMsg(dtos); return abClientService.recordAndSendABClientMsg(dtos) ?
// 返回校验成功的结果 CommonResponse.createBySuccess() : CommonResponse.createByErrorMessage("调用失败请重试");
return CommonResponse.createBySuccess();
} }
/** /**

@ -21,7 +21,7 @@ public interface ABClientService {
/** /**
* , * ,
*/ */
void recordAndSendABClientMsg(List<ABMessageDTO> dto); boolean recordAndSendABClientMsg(List<ABMessageDTO> dto);
/** /**
* , * ,

@ -6,8 +6,10 @@ import com.yuyou.openapi.openapi.model.dto.ABMessageDTO;
import com.yuyou.openapi.openapi.model.dto.ABZMMessageDTO; import com.yuyou.openapi.openapi.model.dto.ABZMMessageDTO;
import com.yuyou.openapi.openapi.service.ABClientService; import com.yuyou.openapi.openapi.service.ABClientService;
import com.yuyou.openapi.openapi.task.ABDownTask; import com.yuyou.openapi.openapi.task.ABDownTask;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -23,6 +25,7 @@ import java.util.List;
* x 2020/8/4 v1.0 * x 2020/8/4 v1.0
*/ */
@Service @Service
@Slf4j
public class ABClientServiceImpl implements ABClientService { public class ABClientServiceImpl implements ABClientService {
@ -33,15 +36,20 @@ public class ABClientServiceImpl implements ABClientService {
private ABMessageRepository abMessageRepository; private ABMessageRepository abMessageRepository;
@Override @Override
public void recordAndSendABClientMsg(List<ABMessageDTO> dtos) { public boolean recordAndSendABClientMsg(List<ABMessageDTO> dtos) {
// 调用接口进行入库 // 调用接口进行入库
ArrayList<ABMessageDO> abMessageDOS = new ArrayList<>(); ArrayList<ABMessageDO> abMessageDOS = new ArrayList<>();
// TODO: 2020/8/10 0010 加密存储
List<ABMessageDO> dos = abMessageRepository.saveAll(abMessageDOS); List<ABMessageDO> dos = abMessageRepository.saveAll(abMessageDOS);
// TODO: 2020/8/10 0010 需要规划返回值类型 if (CollectionUtils.isEmpty(dos)){
log.error("========== [insert data error , please check .] ==========");
return Boolean.FALSE;
}
// TODO: 2020/8/10 0010 解密 发送
// 调用异步任务进行转发AB单 - 这里是这有一条数据 // 调用异步任务进行转发AB单 - 这里是这有一条数据
// TODO: 2020/8/10 0010 经过加密类进行处理 dtos
boolean handleResult = abDownTask.doRunTask(dtos);
// 返回处理结果 // 返回处理结果
abDownTask.doRunTask(dtos);
return Boolean.TRUE;
} }
/** /**

@ -22,7 +22,7 @@ spring:
ab: ab:
customer: customer:
url: https://sandbox.openapi.ppke.com.cn/ url: https://sandbox.openapi.ppke.com.cn/
app_id: app_id app_id: YY9X8XCZ
thread_pool: thread_pool:
corePoolSize: 8 corePoolSize: 8
maxPoolSize: 8 maxPoolSize: 8

Loading…
Cancel
Save