采购收货确认修正解析SAP结果错误
This commit is contained in:
parent
6e5974fb14
commit
dd9b09b2d0
@ -14,6 +14,8 @@ import com.foreverwin.iep.integration.utils.Local;
|
||||
import com.foreverwin.mom.common.security.util.SecurityUtils;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
@ -31,6 +33,7 @@ public class MaterialConsumptionService implements HandlerService {
|
||||
|
||||
// ---------------------------- 批次物料消耗逻辑开始 -----------------------------------------------------
|
||||
@Override
|
||||
@Transactional(propagation = Propagation.REQUIRES_NEW)
|
||||
public InvokeResponse call(InvokeRequest invokeRequest) {
|
||||
String reqId = invokeRequest.getTransSid();
|
||||
InvokeResponse invokeResponse = new InvokeResponse(invokeRequest);
|
||||
@ -48,7 +51,7 @@ public class MaterialConsumptionService implements HandlerService {
|
||||
JSONObject bodyJson = jsonObject.getJSONObject("RESPONSE_BODY");
|
||||
JSONObject outJson = bodyJson.getJSONObject("ES_OUTPUT");
|
||||
String result = outJson.getString("MSGTY");
|
||||
status = "S".equals(result) ? "E" : result;
|
||||
status = !"S".equals(result) ? "E" : result;
|
||||
String message = outJson.getString("MSGTX");
|
||||
invokeResponse.setMessageContent(StringUtils.isEmpty(message) ? "成功" : message);
|
||||
}
|
||||
|
||||
@ -25,6 +25,7 @@ import lombok.AllArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
@ -127,9 +128,9 @@ public class RegisterDocumentServiceImpl implements RegisterDocumentService {
|
||||
invokeResponse.setMessageContent(e.getMessage());
|
||||
}
|
||||
// 如果处理失败,抛出异常,让其回滚
|
||||
/*if ("E".equals(invokeResponse.getResult())) {
|
||||
if ("E".equals(invokeResponse.getResult())) {
|
||||
throw BusinessException.build(invokeResponse.getMessageContent());
|
||||
}*/
|
||||
}
|
||||
return invokeResponse;
|
||||
}
|
||||
|
||||
@ -256,7 +257,7 @@ public class RegisterDocumentServiceImpl implements RegisterDocumentService {
|
||||
}
|
||||
bodyRe.put("IT_INPUT", itemList);
|
||||
jsonObject.put("REQUEST_BODY", bodyRe);
|
||||
return JsonUtils.converToString(jsonObject);
|
||||
return jsonObject.toJSONString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user