| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | |
| | | JSONObject std_data = jsonObject.getJSONObject("std_data"); |
| | | JSONObject execution = std_data.getJSONObject("execution"); |
| | | String code = execution.getString("code"); |
| | | JSONObject std_data1 = jsonObject.getJSONObject("parameter"); |
| | | JSONObject std_data1 = std_data.getJSONObject("parameter"); |
| | | JSONObject execution1 = std_data1.getJSONObject("response_result"); |
| | | String status = execution1.getString("Status"); |
| | | |
| | |
| | | throw new CoolException("服务器内部错误,请联系管理员"); |
| | | } |
| | | } else { |
| | | orderService.updateSettle(order.getId(), 7L, null); |
| | | log.error("请求接口失败!!!url:{};request:{};response:{}", MesConstant.URL + MesConstant.PAKIN_URL, body, response); |
| | | throw new CoolException("上报mes系统失败"); |
| | | } |
| | |
| | | } |
| | | |
| | | Map<String, Object> getHeaders(){ |
| | | // digi-type: sync |
| | | // digi-protocol: raw |
| | | // digi-host: {"prod":"XThirdParty","ver":"1.0","ip":"61.153.227.86","id":"XWMS","timezone":"+8","timestamp":"20240613062240538","acct":"dcms"} |
| | | // digi-service: {"prod":"E10","name":"XCommon.ImportData","id":"XFX","ip":"139.196.196.39"} |
| | | // digi-key: 504011D3B5AD32B465FE0C097C7FDAAC |
| | | // digi-datakey: XCommon.ImportData |
| | | // 获取当前时间 |
| | | LocalDateTime now = LocalDateTime.now(); |
| | | |
| | | // 定义日期时间格式化器,根据你的需求定义格式 |
| | | DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMddHHmmssSSS"); |
| | | |
| | | // 格式化日期时间为字符串 |
| | | String formattedDateTime = now.format(formatter); |
| | | |
| | | JSONObject digiHost = new JSONObject(); |
| | | digiHost.put("prod","XThirdParty"); |
| | | digiHost.put("ver","1.0"); |
| | | digiHost.put("ip","192.168.10.160"); |
| | | digiHost.put("ip","61.153.227.86"); |
| | | digiHost.put("id","XWMS"); |
| | | digiHost.put("timezone","+8"); |
| | | digiHost.put("timestamp",new Date().getTime()); |
| | | digiHost.put("timestamp",formattedDateTime); |
| | | digiHost.put("acct","dcms"); |
| | | |
| | | JSONObject digiService = new JSONObject(); |
| | | digiService.put("prod","E10"); |
| | | digiService.put("name","XCommon.ImportData"); |
| | | digiService.put("ip","192.168.10.160"); |
| | | digiService.put("id","SW_TEST_External"); |
| | | digiService.put("ip","139.196.196.39"); |
| | | digiService.put("id","XFX"); |
| | | |
| | | String key = digiHost.toJSONString() + digiService.toJSONString(); |
| | | String keyMd5 = DigestUtils.md5Hex(key); |