| | |
| | | @Slf4j |
| | | public class ERPController { |
| | | |
| | | public static JSONArray map = new JSONArray(); |
| | | |
| | | @Resource |
| | | private ErpReportService erpReportService; |
| | | |
| | |
| | | JSONArray params = paramsFormat(objParams); |
| | | List<Order> orderList = JSON.parseArray(params.toJSONString(), Order.class); |
| | | // 数据处理,转发server |
| | | return CommonResponse.ok(); |
| | | StringBuffer errorMsg = new StringBuffer(); |
| | | for (Order order : orderList) { |
| | | String i = erpReportService.addOrderToServer(order); |
| | | if (i.equals("200")){ |
| | | errorMsg.append(order.getOrderNo()+"下发成功;"); |
| | | } else { |
| | | errorMsg.append(order.getOrderNo()+"下发失败,原因:"+i+";"); |
| | | } |
| | | } |
| | | return CommonResponse.ok(errorMsg.toString()); |
| | | } |
| | | |
| | | @ApiOperation("入/出库任务通知单取消") |
| | |
| | | " \"stockOrgId\": \"ORG001\"\n" + |
| | | " }\n" + |
| | | "]"; |
| | | return CommonResponse.ok(JSONArray.parseArray(x, InventoryDetails.class)); |
| | | if (map == null || map.isEmpty()) { |
| | | map = JSON.parseArray(x); |
| | | } |
| | | return CommonResponse.ok(JSONArray.parseArray(map.toJSONString(), InventoryDetails.class)); |
| | | } |
| | | |
| | | InventoryQueryCondition condition = JSON.parseObject(params.toJSONString(), InventoryQueryCondition.class); |
| | |
| | | // region 测试推送功能 |
| | | @ApiOperation("登录") |
| | | @PostMapping("/loginBySign") |
| | | public CommonResponse loginBySign(@RequestBody Object objParams) { |
| | | public CommonResponse loginBySign() { |
| | | try { |
| | | erpReportService.loginBySign(); |
| | | return CommonResponse.ok(erpReportService.loginBySign()); |
| | | } catch (Exception e) { |
| | | log.error("erp, loginBySign", e); |
| | | } |
| | |
| | | @PostMapping("/reportInOrOutBound") |
| | | public CommonResponse reportInOrOutBound(@RequestBody Object objParams) { |
| | | try { |
| | | erpReportService.reportInOrOutBound(objParams); |
| | | return erpReportService.reportInOrOutBound(objParams); |
| | | } catch (Exception e) { |
| | | log.error("erp, reportInOrOutBound", e); |
| | | } |