6/21 同步优化
parent
38aec42f54
commit
7e14b47152
@ -0,0 +1,54 @@
|
||||
package com.glxp.api.controller.inout;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.glxp.api.common.res.BaseResponse;
|
||||
import com.glxp.api.common.util.ResultVOUtils;
|
||||
import com.glxp.api.constant.SocketMsgType;
|
||||
import com.glxp.api.controller.BaseController;
|
||||
import com.glxp.api.controller.sync.SpsSyncWebSocket;
|
||||
import com.glxp.api.entity.sync.SocketMsgEntity;
|
||||
import com.glxp.api.req.basic.BasicDataRequest;
|
||||
import com.glxp.api.req.inout.FilterOrderDetailResultRequest;
|
||||
import com.glxp.api.req.inout.FilterStatDataRequest;
|
||||
import com.glxp.api.service.inout.IoStatDataService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.junit.Test;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 出入库汇总Test 测试 远程连接
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
public class IoStatDataController extends BaseController {
|
||||
|
||||
// @Resource
|
||||
// RestTemplate restTemplate;
|
||||
|
||||
|
||||
|
||||
@Resource
|
||||
IoStatDataService ioStatDataService;
|
||||
|
||||
|
||||
@GetMapping("/udiwms/inout/stat/filter")
|
||||
public void filterList(FilterStatDataRequest statDataRequest) {
|
||||
|
||||
ioStatDataService.getData(statDataRequest);
|
||||
|
||||
// BasicDataRequest request = webSocketServer.insert(basicDataRequest,userId+"");
|
||||
// request.setFilterOrderDetailResultRequest(orderDetailResultRequest);
|
||||
// webSocketServer.sendMessage(SocketMsgEntity.builder().type(SocketMsgType.STAT_DATA_REQUEST).content(request).remark("汇总日报").build(), null);
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.glxp.api.res.inout;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author : zhangsan
|
||||
* @date : 2024/5/22 17:31
|
||||
* @modyified By :
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("扫码单据列表信息")
|
||||
public class IoStatDataResponse {
|
||||
|
||||
String code;
|
||||
String message;
|
||||
Object data;
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
package com.glxp.api.service.inout;
|
||||
|
||||
import com.glxp.api.constant.SocketMsgType;
|
||||
import com.glxp.api.controller.sync.SpsSyncWebSocket;
|
||||
import com.glxp.api.entity.sync.SocketMsgEntity;
|
||||
import com.glxp.api.req.inout.FilterStatDataRequest;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* @author : zhangsan
|
||||
* @date : 2024/5/23 15:11
|
||||
* @modyified By :
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class IoStatDataService {
|
||||
|
||||
|
||||
|
||||
|
||||
@Value("${WEBSOCKET_TOKEN}")
|
||||
private String socketToken;
|
||||
|
||||
@Resource
|
||||
SpsSyncWebSocket spsSyncWebSocket;
|
||||
public void getData(FilterStatDataRequest statDataRequest) {
|
||||
//推送
|
||||
SocketMsgEntity socketMsgEntity = SocketMsgEntity.builder().content(statDataRequest).type(SocketMsgType.STAT_DATA).remark("我胡乱说的").build();
|
||||
spsSyncWebSocket.sendMessage(socketMsgEntity, "1:" + socketToken);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue