|
|
@ -12,6 +12,7 @@ import com.foreverwin.mesnac.integration.mapper.IntegrationLogMapper;
|
|
|
|
import com.foreverwin.mesnac.integration.model.IntegrationLog;
|
|
|
|
import com.foreverwin.mesnac.integration.model.IntegrationLog;
|
|
|
|
import com.foreverwin.mesnac.integration.service.IntegrationLogService;
|
|
|
|
import com.foreverwin.mesnac.integration.service.IntegrationLogService;
|
|
|
|
import com.foreverwin.modular.core.exception.BaseException;
|
|
|
|
import com.foreverwin.modular.core.exception.BaseException;
|
|
|
|
|
|
|
|
import com.foreverwin.modular.core.exception.BusinessException;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import org.springframework.transaction.annotation.Propagation;
|
|
|
|
import org.springframework.transaction.annotation.Propagation;
|
|
|
@ -43,7 +44,13 @@ public class IntegrationLogServiceImpl extends ServiceImpl<IntegrationLogMapper,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void redoSend(String handle) {
|
|
|
|
@Transactional(propagation = Propagation.REQUIRES_NEW)
|
|
|
|
|
|
|
|
public void updateIntegrationLog(IntegrationLog integrationLog) {
|
|
|
|
|
|
|
|
integrationLogMapper.updateById(integrationLog);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public String redoSend(String handle) {
|
|
|
|
IntegrationLog byId = getById(handle);
|
|
|
|
IntegrationLog byId = getById(handle);
|
|
|
|
if (byId==null||!byId.getStatus().equals("R")){
|
|
|
|
if (byId==null||!byId.getStatus().equals("R")){
|
|
|
|
throw new BaseException("状态已变更,请刷新");
|
|
|
|
throw new BaseException("状态已变更,请刷新");
|
|
|
@ -73,16 +80,18 @@ public class IntegrationLogServiceImpl extends ServiceImpl<IntegrationLogMapper,
|
|
|
|
if (!status.equals("S")) {
|
|
|
|
if (!status.equals("S")) {
|
|
|
|
throw new BaseException("ERP接口返回错误消息:" + message);
|
|
|
|
throw new BaseException("ERP接口返回错误消息:" + message);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
byId.setStatus(status);
|
|
|
|
|
|
|
|
byId.setResultMessage(message);
|
|
|
|
|
|
|
|
updateById(byId);
|
|
|
|
} catch (RemoteException e) {
|
|
|
|
} catch (RemoteException e) {
|
|
|
|
throw new BaseException("ERP接口错误: " + e.getMessage());
|
|
|
|
|
|
|
|
} finally {
|
|
|
|
|
|
|
|
byId.setRequestDateTime(LocalDateTime.now());
|
|
|
|
byId.setRequestDateTime(LocalDateTime.now());
|
|
|
|
byId.setResultMessage(message);
|
|
|
|
byId.setResultMessage("ERP接口错误:" + e.getMessage());
|
|
|
|
if (status.equals("S")){
|
|
|
|
// updateById(byId);
|
|
|
|
byId.setStatus(status);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
updateById(byId);
|
|
|
|
updateById(byId);
|
|
|
|
|
|
|
|
// throw new BaseException("ERP接口错误: " + e.getMessage());
|
|
|
|
|
|
|
|
return e.getMessage();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|