单据数据传递给u8通了;代码中//TODO 张超注释的,上线时需要打开注释
|  |  |  | 
|---|
|  |  |  | case "MO": | 
|---|
|  |  |  | mappingPakInOrderParam(param, true, "银座委外生产订单"); | 
|---|
|  |  |  | if (!Cools.isEmpty(param.getChildren())) { | 
|---|
|  |  |  | mappingOrderParamChild(param, false, "银座委外生产材料出库单"); | 
|---|
|  |  |  | mappingOrderParamChild(param, false, "银座委外材料出库单"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | case "OM": | 
|---|
|  |  |  | 
|---|
|  |  |  | mappingPakOutOrderParam(param, true, "银座采购入库单"); | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | case "MO": | 
|---|
|  |  |  | mappingPakInOrderParam(param, true, "银座委外生产订单"); | 
|---|
|  |  |  | if (!Cools.isEmpty(param.getChildren())) { | 
|---|
|  |  |  | mappingOrderParamChild(param, false, "银座委外生产材料出库单"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | case "OM": | 
|---|
|  |  |  | mappingPakInOrderParam(param, true, "银座生产订单"); | 
|---|
|  |  |  | if (!Cools.isEmpty(param.getChildren())) { | 
|---|
|  |  |  | mappingOrderParamChild(param, false, "银座生产材料出库单"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | case "OM": | 
|---|
|  |  |  | mappingPakInOrderParam(param, true, "银座委外生产订单"); | 
|---|
|  |  |  | if (!Cools.isEmpty(param.getChildren())) { | 
|---|
|  |  |  | mappingOrderParamChild(param, false, "银座委外材料出库单"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | case "采购入库单退货": | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //生成单据明细 | 
|---|
|  |  |  | OrderSyncParam.OrderDetl orderDetl = new OrderSyncParam.OrderDetl(); | 
|---|
|  |  |  | Synchro.Copy(param,orderDetl); | 
|---|
|  |  |  | Synchro.Copy(param, orderDetl); | 
|---|
|  |  |  | //orderDetl.setcInvCode(param.getCInvCode()); | 
|---|
|  |  |  | //orderDetl.setiQuantity(param.getIQuantity()); | 
|---|
|  |  |  | orderDetl.setCDefine22(param.getIvouchrowno()); | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | List<OrderProdSyncParam.ChildInfo> child = param.getChildren(); | 
|---|
|  |  |  | Synchro.Copy(param, orderSyncParam); | 
|---|
|  |  |  | orderSyncParam.set操作系统号(param.get操作系统号()); | 
|---|
|  |  |  | orderSyncParam.setCPOID(child.get(0).getOrderNoT()); | 
|---|
|  |  |  | orderSyncParam.setDdate(param.getOrderTime()); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | orderDetl.setCDefine22(param.getIvouchrowno()); | 
|---|
|  |  |  | orderDetl.setCsocode(param.getCsocode()); | 
|---|
|  |  |  | orderDetl.setId(childInfo.getIds()); | 
|---|
|  |  |  | orderDetl.setIvouchrowno(childInfo.getIvouchrowno()); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //orderDetl.setIvouchrowno(childInfo.getIvouchrowno()); | 
|---|
|  |  |  | orderDetls.add(orderDetl); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | orderSyncParam.setChildren(orderDetls); | 
|---|
|  |  |  | 
|---|
|  |  |  | //String barcode = agvLocDetls.get(0).getSuppCode(); | 
|---|
|  |  |  | String containerCode = taskDto.getLocDtos().get(0).getContainerCode(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | AgvLocMast agvLocMast = agvLocMastService.selectById(sourceLocNo); | 
|---|
|  |  |  | //判断是否全板出库 | 
|---|
|  |  |  | int ioType = isPakOut(sourceLocNo,taskDto) ?  101 : 103; | 
|---|
|  |  |  | //生成工作档 | 
|---|
|  |  |  | AgvWrkMast wrkMast = createWrkMast(ioType,wrkSts,sourceLocNo,targetLocNo,containerCode,now,userId,Short.valueOf(containerCode.substring(0,2)),null); | 
|---|
|  |  |  | AgvWrkMast wrkMast = createWrkMast(ioType,wrkSts,sourceLocNo,targetLocNo,containerCode,now,userId,Short.valueOf(containerCode.substring(0,2)),agvLocMast.getPltType()); | 
|---|
|  |  |  | //生成工作档明细 | 
|---|
|  |  |  | long flowId = snowflakeIdWorker.nextId(); | 
|---|
|  |  |  | taskDto.getLocDtos().forEach(locDto -> { | 
|---|
|  |  |  | 
|---|
|  |  |  | //String barcode = agvLocDetls.get(0).getSuppCode(); | 
|---|
|  |  |  | String containerCode = taskDto.getLocDtos().get(0).getContainerCode(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | AgvLocMast agvLocMast = agvLocMastService.selectById(sourceLocNo); | 
|---|
|  |  |  | //判断是否全板出库 | 
|---|
|  |  |  | int ioType = 107; | 
|---|
|  |  |  | //生成工作档 | 
|---|
|  |  |  | AgvWrkMast wrkMast = createWrkMast(ioType,wrkSts,sourceLocNo,targetLocNo,containerCode,now,userId,Short.valueOf(containerCode.substring(0,2)),null); | 
|---|
|  |  |  | AgvWrkMast wrkMast = createWrkMast(ioType,wrkSts,sourceLocNo,targetLocNo,containerCode,now,userId,Short.valueOf(containerCode.substring(0,2)),agvLocMast.getPltType()); | 
|---|
|  |  |  | //生成工作档明细 | 
|---|
|  |  |  | long flowId = snowflakeIdWorker.nextId(); | 
|---|
|  |  |  | taskDto.getLocDtos().forEach(locDto -> { | 
|---|
|  |  |  | 
|---|
|  |  |  | wrkMast.setCrnNo(outMost?outCrnNo:locMast.getCrnNo()); | 
|---|
|  |  |  | wrkMast.setSourceStaNo(sourceStaNo); // 源站 | 
|---|
|  |  |  | wrkMast.setStaNo(stnNo); // 目标站 | 
|---|
|  |  |  | wrkMast.setPltType(locMast.getPltType()); | 
|---|
|  |  |  | if(ioType == 101 && taskDto.getStaNo()>=300){ | 
|---|
|  |  |  | wrkMast.setSourceStaNo(346); // 源站 | 
|---|
|  |  |  | wrkMast.setStaNo(346); // 目标站 | 
|---|
|  |  |  | 
|---|
|  |  |  | try{ | 
|---|
|  |  |  | agvWrkMastHandler.completedCarryWrk(agvWrkMast); | 
|---|
|  |  |  | } catch (Exception e){ | 
|---|
|  |  |  | //e.printStackTrace(); | 
|---|
|  |  |  | log.error("工作号"+agvWrkMast.getWrkNo()+"定时处理AGV工作档中工作状态为206,处理失败:===》异常原因:"+e.getMessage()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | 
|---|
|  |  |  | wrkMast.setAppeTime(now); | 
|---|
|  |  |  | wrkMast.setModiUser(9527L); | 
|---|
|  |  |  | wrkMast.setModiTime(now); | 
|---|
|  |  |  | wrkMast.setPltType(agvWrkMast.getPltType()); | 
|---|
|  |  |  | wrkMast.setLogErrMemo("completedCarryWrk"); | 
|---|
|  |  |  | if (!agvWrkMastService.insertByIncrease(wrkMast)) { | 
|---|
|  |  |  | throw new CoolException("保存工作档失败"); | 
|---|
|  |  |  | 
|---|
|  |  |  | reportMes(agvWrkMast, agvWrkDetlListOld); | 
|---|
|  |  |  | return SUCCESS; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Transactional | 
|---|
|  |  |  | public ReturnT<String> completedCarryWrk2(AgvWrkMast agvWrkMast) { | 
|---|
|  |  |  | 
|---|
|  |  |  | } catch (Exception e) { | 
|---|
|  |  |  | log.error("" + e.getMessage()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | reportMes(agvWrkMast, agvWrkDetlListOld); | 
|---|
|  |  |  | //TODO 张超 | 
|---|
|  |  |  | //reportMes(agvWrkMast, agvWrkDetlListOld); | 
|---|
|  |  |  | return SUCCESS; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | boolean success = false; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | response = new HttpHandler.Builder() | 
|---|
|  |  |  | .setUri(url) | 
|---|
|  |  |  | .setPath(path) | 
|---|
|  |  |  | .setHeaders(headParam) | 
|---|
|  |  |  | .setJson(JSONObject.toJSONString(requestParam)) | 
|---|
|  |  |  | .setHttps(true) | 
|---|
|  |  |  | .build() | 
|---|
|  |  |  | .doPost(); | 
|---|
|  |  |  | response = new HttpHandler.Builder().setUri(url).setPath(path).setHeaders(headParam).setJson(JSONObject.toJSONString(requestParam)).setHttps(true).build().doPost(); | 
|---|
|  |  |  | JSONObject jsonObject = JSON.parseObject(response); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (Cools.isEmpty(jsonObject.get("code")) || Integer.parseInt(jsonObject.get("code").toString()) != 200) { | 
|---|
|  |  |  | throw new CoolException(jsonObject.get("dsc").toString()); | 
|---|
|  |  |  | log.info("mes接口调用失败,返回信息:" + jsonObject); | 
|---|
|  |  |  | //TODO 张超 | 
|---|
|  |  |  | //throw new CoolException("mes接口调用失败,返回信息:" + jsonObject); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | success = true; | 
|---|
|  |  |  | return jsonObject; | 
|---|
|  |  |  | 
|---|
|  |  |  | log.error(e.getMessage()); | 
|---|
|  |  |  | throw new CoolException(e.getMessage()); | 
|---|
|  |  |  | } finally { | 
|---|
|  |  |  | apiLogService.save( | 
|---|
|  |  |  | namespace, | 
|---|
|  |  |  | url + path, | 
|---|
|  |  |  | appkey, | 
|---|
|  |  |  | ip, | 
|---|
|  |  |  | JSON.toJSONString(JSONObject.toJSONString(requestParam)), | 
|---|
|  |  |  | response, | 
|---|
|  |  |  | success | 
|---|
|  |  |  | ); | 
|---|
|  |  |  | apiLogService.save(namespace, url + path, appkey, ip, JSON.toJSONString(JSONObject.toJSONString(requestParam)), response, success); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | @Transactional | 
|---|
|  |  |  | public void timelyStart(Order order) { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | List<String> docNames = new ArrayList<>(Arrays.asList("银座采购入库单", "银座委外材料出库单","银座生产材料出库单")); | 
|---|
|  |  |  | List<String> docNames = new ArrayList<>(Arrays.asList("银座采购入库单", "银座委外材料出库单", "银座生产材料出库单")); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | DocType docType = docTypeService.selectById(order.getDocType()); | 
|---|
|  |  |  | if (docNames.contains(docType.getDocName())) { | 
|---|