中继服务bug修改,直连,单据上传,单据验收,一些字段缺失补充
							parent
							
								
									323ae91c94
								
							
						
					
					
						commit
						1c003688cb
					
				| @ -0,0 +1,135 @@ | |||||||
|  | package com.glxp.sale.admin.controller.sync; | ||||||
|  | 
 | ||||||
|  | import cn.hutool.core.util.StrUtil; | ||||||
|  | import com.alibaba.fastjson.JSONObject; | ||||||
|  | import com.alibaba.fastjson.TypeReference; | ||||||
|  | import com.glxp.sale.admin.annotation.AuthRuleAnnotation; | ||||||
|  | import com.glxp.sale.admin.entity.sync.PostOrderRequest; | ||||||
|  | import com.glxp.sale.admin.http.UHttpClient; | ||||||
|  | import com.glxp.sale.admin.req.sync.OrderFilterRequest; | ||||||
|  | import com.glxp.sale.common.res.BaseResponse; | ||||||
|  | import com.glxp.sale.common.util.ResultVOUtils; | ||||||
|  | import org.springframework.beans.factory.annotation.Value; | ||||||
|  | import org.springframework.http.HttpHeaders; | ||||||
|  | import org.springframework.web.bind.annotation.GetMapping; | ||||||
|  | import org.springframework.web.bind.annotation.PostMapping; | ||||||
|  | import org.springframework.web.bind.annotation.RequestBody; | ||||||
|  | import org.springframework.web.bind.annotation.RestController; | ||||||
|  | 
 | ||||||
|  | import java.util.HashMap; | ||||||
|  | import java.util.Map; | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | //直连UDI自助平台接口
 | ||||||
|  | 
 | ||||||
|  | @RestController | ||||||
|  | public class DirectConnectController { | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |     @Value("${SPMS_IP}") | ||||||
|  |     private String spmsUrl; | ||||||
|  |     @Value("${API_KEY}") | ||||||
|  |     private String apiKey; | ||||||
|  |     @Value("${API_SECRET}") | ||||||
|  |     private String apiSecret; | ||||||
|  | 
 | ||||||
|  |     public HttpHeaders getHeaders() { | ||||||
|  |         HttpHeaders headers = new HttpHeaders(); | ||||||
|  |         headers.add("Content-Type", "application/json"); | ||||||
|  |         headers.add("api_key", apiKey); | ||||||
|  |         headers.add("secret_key", apiSecret); | ||||||
|  |         return headers; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |     //单据验收
 | ||||||
|  |     @PostMapping("/sps/review/download/order/finsih") | ||||||
|  |     public BaseResponse reviewOrder(@RequestBody OrderFilterRequest orderFilterRequest) { | ||||||
|  |         String result = UHttpClient.postJson(spmsUrl + "/spms/inout/order/check/updateStatus", orderFilterRequest, getHeaders()); | ||||||
|  |         BaseResponse<String> response = | ||||||
|  |                 JSONObject.parseObject(result, new TypeReference<BaseResponse<String>>() { | ||||||
|  |                 }); | ||||||
|  |         return response; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     //获取未验收的单据
 | ||||||
|  |     @GetMapping("/sps/review/download/order") | ||||||
|  |     public BaseResponse downloadOrder(OrderFilterRequest orderFilterRequest) { | ||||||
|  |         Map<String, Object> paramMap = new HashMap<>(16); | ||||||
|  |         if (StrUtil.isNotEmpty(orderFilterRequest.getWmsUserId())) { | ||||||
|  |             paramMap.put("wmsUserId", orderFilterRequest.getWmsUserId()); | ||||||
|  |         } | ||||||
|  |         if (StrUtil.isNotEmpty(orderFilterRequest.getWmsUserName())) { | ||||||
|  |             paramMap.put("wmsUserName", orderFilterRequest.getWmsUserName()); | ||||||
|  |         } | ||||||
|  |         paramMap.put("orderId", orderFilterRequest.getOrderId()); | ||||||
|  |         paramMap.put("action", orderFilterRequest.getAction()); | ||||||
|  |         String response = UHttpClient.mipsGetHead(spmsUrl + "/udiwms/inout/order/download", paramMap, getHeaders()); | ||||||
|  |         try { | ||||||
|  |             BaseResponse data = JSONObject.parseObject(response, new TypeReference<BaseResponse>() { | ||||||
|  |             }); | ||||||
|  |             return data; | ||||||
|  |         } catch (Exception e) { | ||||||
|  |             e.printStackTrace(); | ||||||
|  |             return ResultVOUtils.error(500, "连接失败!"); | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     //获取未验收的单据详情
 | ||||||
|  |     @GetMapping("/sps/review/download/orderDetail") | ||||||
|  |     public BaseResponse downloadOrderDetail(OrderFilterRequest orderFilterRequest) { | ||||||
|  |         Map<String, Object> paramMap = new HashMap<>(16); | ||||||
|  |         if (StrUtil.isNotEmpty(orderFilterRequest.getWmsUserId())) { | ||||||
|  |             paramMap.put("wmsUserId", orderFilterRequest.getWmsUserId()); | ||||||
|  |         } | ||||||
|  |         if (StrUtil.isNotEmpty(orderFilterRequest.getWmsUserName())) { | ||||||
|  |             paramMap.put("wmsUserName", orderFilterRequest.getWmsUserName()); | ||||||
|  |         } | ||||||
|  |         paramMap.put("orderId", orderFilterRequest.getOrderId()); | ||||||
|  | 
 | ||||||
|  |         String response = UHttpClient.mipsGetHead(spmsUrl + "/warehouse/inout/order/detail", paramMap, getHeaders()); | ||||||
|  |         try { | ||||||
|  |             BaseResponse data = JSONObject.parseObject(response, new TypeReference<BaseResponse>() { | ||||||
|  |             }); | ||||||
|  |             return data; | ||||||
|  |         } catch (Exception e) { | ||||||
|  |             e.printStackTrace(); | ||||||
|  |             return ResultVOUtils.error(500, "连接失败!"); | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |     //获取未验收的单据条码
 | ||||||
|  |     @GetMapping("/sps/review/download/codes") | ||||||
|  |     public BaseResponse downloadCodes(OrderFilterRequest orderFilterRequest) { | ||||||
|  |         Map<String, Object> paramMap = new HashMap<>(16); | ||||||
|  |         if (StrUtil.isNotEmpty(orderFilterRequest.getWmsUserId())) { | ||||||
|  |             paramMap.put("wmsUserId", orderFilterRequest.getWmsUserId()); | ||||||
|  |         } | ||||||
|  |         if (StrUtil.isNotEmpty(orderFilterRequest.getWmsUserName())) { | ||||||
|  |             paramMap.put("wmsUserName", orderFilterRequest.getWmsUserName()); | ||||||
|  |         } | ||||||
|  |         paramMap.put("orderId", orderFilterRequest.getOrderId()); | ||||||
|  |         String response = UHttpClient.mipsGetHead(spmsUrl + "/spms/inout/dlcode/findByOrderId", paramMap, getHeaders()); | ||||||
|  |         try { | ||||||
|  |             BaseResponse data = JSONObject.parseObject(response, new TypeReference<BaseResponse>() { | ||||||
|  |             }); | ||||||
|  |             return data; | ||||||
|  |         } catch (Exception e) { | ||||||
|  |             e.printStackTrace(); | ||||||
|  |             return ResultVOUtils.error(500, "连接失败!"); | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     //手持终端单据提交
 | ||||||
|  |     @PostMapping("/sps/pda/upload/orders") | ||||||
|  |     public BaseResponse uploadOrder(@RequestBody PostOrderRequest postOrderRequest) { | ||||||
|  |         String result = UHttpClient.postJson(spmsUrl + "/warehouse/inout/postOrders", postOrderRequest, getHeaders()); | ||||||
|  |         BaseResponse<String> response = | ||||||
|  |                 JSONObject.parseObject(result, new TypeReference<BaseResponse<String>>() { | ||||||
|  |                 }); | ||||||
|  |         return response; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | } | ||||||
| @ -0,0 +1,29 @@ | |||||||
|  | package com.glxp.sale.admin.entity.info; | ||||||
|  | 
 | ||||||
|  | import lombok.Data; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * 仓库字典-单据类型关联表 | ||||||
|  |  */ | ||||||
|  | @Data | ||||||
|  | public class WarehouseBussinessTypeEntity { | ||||||
|  |     /** | ||||||
|  |      * id | ||||||
|  |      */ | ||||||
|  |     private Integer id; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 仓位码 | ||||||
|  |      */ | ||||||
|  |     private String code; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 业务类型 | ||||||
|  |      */ | ||||||
|  |     private String action; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 业务名称 | ||||||
|  |      */ | ||||||
|  |     private String name; | ||||||
|  | } | ||||||
| @ -0,0 +1,37 @@ | |||||||
|  | package com.glxp.sale.admin.entity.info; | ||||||
|  | 
 | ||||||
|  | import lombok.Data; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * 仓库字典-用户关联表 | ||||||
|  |  */ | ||||||
|  | @Data | ||||||
|  | public class WarehouseUserEntity { | ||||||
|  |     /** | ||||||
|  |      * id | ||||||
|  |      */ | ||||||
|  |     private Integer id; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 仓位码 | ||||||
|  |      */ | ||||||
|  |     private String code; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 用户id | ||||||
|  |      */ | ||||||
|  |     private Long userid; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 用户名/登录账号 | ||||||
|  |      */ | ||||||
|  |     private String username; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 是否是仓库主管 | ||||||
|  |      */ | ||||||
|  |     private boolean isDirector; | ||||||
|  | 
 | ||||||
|  |     private String employeeName; | ||||||
|  | 
 | ||||||
|  | } | ||||||
					Loading…
					
					
				
		Reference in New Issue