新增发票确认实时同步

dev2.0
anthonywj 2 years ago
parent 1476a0f894
commit 6a3d9113f6

@ -2,15 +2,13 @@ package com.glxp.api.constant;
public interface SocketMsgType {
String DL_ALL_DATA = "DL_ALL_DATA"; //生产入库
String DL_ALL_DATA = "DL_ALL_DATA"; //基础数据同步
String DL_NOTICE = "DL_NOTICE"; //通知类消息
/**
*
*/
String TASK_INVOICE_CONFIRM = "TASK_INVOICE_CONFIRM"; //发票确认
}

@ -182,6 +182,17 @@ public class SpGetHttpClient {
return response;
}
public BaseResponse<IoOrderEntity> getOrderByBillNo(String billNo) {
List<String> header = (List<String>) Convert.toList(buildHeader());
String result = okHttpCli.doGet(getIpUrl() + "/directToSpms" + "/udiwms/inout/order/findByBillNo/" + "?billNo=" + billNo, Convert.toStrArray(header));
BaseResponse<IoOrderEntity> response =
JSONObject.parseObject(result, new TypeReference<BaseResponse<IoOrderEntity>>() {
});
return response;
}
// 最小销售标识获取国家库信息
public BaseResponse<PageSimpleResponse<ProductInfoEntity>> getSyncDi(ProductInfoFilterRequest productInfoFilterRequest) {

@ -3,9 +3,14 @@ package com.glxp.api.service.sync;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.constant.SocketMsgType;
import com.glxp.api.dao.inout.IoOrderDao;
import com.glxp.api.entity.inout.IoOrderEntity;
import com.glxp.api.entity.sync.SocketMsgEntity;
import com.glxp.api.http.sync.SpGetHttpClient;
import com.glxp.api.service.inout.IoOrderService;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
@ -17,6 +22,8 @@ public class SocketMsgService {
@Value("${SPMS_WEBSOCKET_TOKEN}")
String token;
@Resource
SpGetHttpClient spGetHttpClient;
@Async
public void dealNoticeMsg(SocketMsgEntity socketMsgEntity) {
@ -33,8 +40,19 @@ public class SocketMsgService {
}
@Resource
IoOrderService orderService;
//发票确认
public void invoiceConfirm(SocketMsgEntity socketMsgEntity) {
String billNo = socketMsgEntity.getContent();
BaseResponse<IoOrderEntity> baseResponse = spGetHttpClient.getOrderByBillNo(billNo);
if (baseResponse != null && baseResponse.getCode() == 20000) {
IoOrderEntity orderEntity = baseResponse.getData();
IoOrderEntity updateEntity = new IoOrderEntity();
updateEntity.setBillNo(orderEntity.getBillNo());
updateEntity.setCheckStatus(orderEntity.getCheckStatus());
orderService.updateByBillNo(updateEntity);
}
}
}

Loading…
Cancel
Save